Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'true,': 0.05; 'literal': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'evaluates': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inf': 0.16; 'infinity': 0.16; 'nan': 0.16; 'subject:where': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'cc:addr:python.org': 0.22; 'math': 0.24; 'cc:2**0': 0.24; 'header :In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'easy': 0.60; 'ian': 0.60; '2015': 0.84; 'do:': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=95wp94zsnuKYswM8Jd7B+xFFsZukOWlnE9up0E7xPOw=; b=vQXE2TqKzEJi4TlAS7q0WWpB7gm0M894E05EOnzLlc471u1AwWBDIWIieqx4SH/qyR 3X/HNwF7M860gBSoCx+Tf41SgNQokatF8RHhnLua5yajR8k9aWhqD+OeN1WGBEaCz8yI NiOSwuqRxnjJKyjcZE+CQXVnrn3IpYWyvTN5U1N/2k+mrgwxgwEtR4bBtPeOKnSG4cli A/YNls71NpIsElZETxtNO2wBmIjj3/3jmSB8bEomymb7j7/PnDRWHSE9gegnYHxMfFU1 QuMZyI7Iltux+63B3+mt2X799fxti3F3oSsrikkpiD9mlF6xrZgTZoQIoE/GHJBlM4rt FP2Q== MIME-Version: 1.0 X-Received: by 10.50.171.201 with SMTP id aw9mr10219630igc.2.1420728307645; Thu, 08 Jan 2015 06:45:07 -0800 (PST) In-Reply-To: <87zj9te3tz.fsf@elektro.pacujo.net> References: <87zj9te3tz.fsf@elektro.pacujo.net> Date: Fri, 9 Jan 2015 01:45:07 +1100 Subject: Re: where in Nan defined From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420728314 news.xs4all.nl 2886 [2001:888:2000:d::a6]:35749 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83341 On Fri, Jan 9, 2015 at 1:37 AM, Marko Rauhamaa wrote: > Ian Kelly : > >> To get nan as a literal just do: >> >> nan = float("nan") > > True, but that got me thinking: what standard Python math operation > evaluates to NaN? Subtracting infinity from infinity is one easy way. >>> 1e309 inf >>> 1e309-1e309 nan ChrisA