Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: NaN comparisons - Call For Anecdotes Date: Thu, 17 Jul 2014 22:10:08 +0300 Organization: A noiseless patient Spider Lines: 17 Message-ID: <877g3b244v.fsf@elektro.pacujo.net> References: <53BC05FB.4050707@jmunch.dk> <53BD70F4.4000504@stoneleaf.us> <53BDAF90.8010709@jmunch.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="20118"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l0+tMRpEtU426h1Rlq5Ca" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:lv8pIv4u+PZKN78K9lieRMSGei4= sha1:92ttysZPFD5F4uAY82fdtw5Sb6w= Xref: csiph.com comp.lang.python:74679 Chris Angelico : > numerical calculations might overflow to +inf or -inf, and then > further calculations can result in a nan, etc, etc. Those are the > sorts of examples that you'd find among SciPy users and such. There is some inconsistency. Mathematically, there are undefined operations, for a good reason. That's because the limits are not unambiguous and that's why 0/0, 0**0, 1/0 and inf-inf are undefined. Why 0/0 results in an exception but inf-inf = nan, I don't see a justification. Marko