Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #110324
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Random832 <random832@fastmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Can math.atan2 return INF? |
| Date | Wed, 22 Jun 2016 12:19:46 -0400 |
| Lines | 25 |
| Message-ID | <mailman.43.1466612389.11516.python-list@python.org> (permalink) |
| References | <57697e61$0$1590$c3e8da3$5496439d@news.astraweb.com> <1mp7m3g.picev12e77h4N%pdorange@pas-de-pub-merci.mac.com> <5769ec12$0$1610$c3e8da3$5496439d@news.astraweb.com> <87d1n9kzk9.fsf@bsb.me.uk> <1466612386.4142308.645389729.149CF4CD@webmail.messagingengine.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de C3LOobT76rNXEXPeTp5GrgI/x5lQWEfbiFwf+axneVxw== |
| Return-Path | <random832@fastmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.004 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; '22,': 0.09; 'mentions': 0.09; 'received:internal': 0.09; 'url:blog': 0.10; 'wed,': 0.15; 'explicitly': 0.15; 'instruction,': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'nan': 0.16; 'rationale': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:66.111.4.27': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:out3-smtp.messagingengine.com': 0.16; 'received:psf.io': 0.16; 'x87': 0.16; 'wrote:': 0.16; '(in': 0.18; '>>>': 0.20; '(the': 0.22; 'arguments': 0.22; 'seems': 0.23; 'header:In-Reply- To:1': 0.24; 'error': 0.27; 'short,': 0.29; 'url:2008': 0.29; 'handled': 0.29; "i'd": 0.31; 'though,': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'surprised': 0.33; 'could': 0.35; 'expected': 0.35; 'but': 0.36; 'too': 0.36; 'skip:i 20': 0.36; 'cases': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'thought': 0.37; 'received:66': 0.38; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.61; 'real': 0.62; 'limit': 0.65; "they're": 0.66; 'results': 0.66; 'special': 0.73; 'presumably': 0.84; 'prescribed': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=yi+BmJku20MmVC3mV5CeBOzVHOM=; b=fW5UKb S8mUez0C2yAOmeLYZVCn02NHadLur8hFvVehSM5GIrKppkeN13qLsi+9Z3vu3oNI 8qMyU6emYrPAxf0mIu3kmEvPUu0skkOtJ+siTw4evm74lBscI0sjvh/xQM7K07VZ j0HeMOZJl0rQpb4Q/Hl5Y3ZiJQ9WHWihMoNj8= |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=yi+BmJku20MmVC3 mV5CeBOzVHOM=; b=sbZwPXkvJhGvuWLjEFl+eW7hnNPGNgXdzqzidqgD+LT4EeE iR+vF+T3Cb6lmayRn6XuWzwgyyizavmUgbZvPkGZqdI63mV7FGdTBsVH51EG5nne DAT7GKuZsPENI9R3xOjpoP1q9rRKdqoBewLejJFu5k/pfbrVDmsjGolESKQw= |
| X-Sasl-Enc | Coy4pEtwUFHmWc6dbe8dozp3FhB6YUQzd12/yziYCrCJ 1466612386 |
| X-Mailer | MessagingEngine.com Webmail Interface - ajax-9635f794 |
| In-Reply-To | <87d1n9kzk9.fsf@bsb.me.uk> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.22 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <1466612386.4142308.645389729.149CF4CD@webmail.messagingengine.com> |
| X-Mailman-Original-References | <57697e61$0$1590$c3e8da3$5496439d@news.astraweb.com> <1mp7m3g.picev12e77h4N%pdorange@pas-de-pub-merci.mac.com> <5769ec12$0$1610$c3e8da3$5496439d@news.astraweb.com> <87d1n9kzk9.fsf@bsb.me.uk> |
| Xref | csiph.com comp.lang.python:110324 |
Show key headers only | View raw
On Wed, Jun 22, 2016, at 11:34, Ben Bacarisse wrote: > Steven D'Aprano <steve@pearwood.info> writes: > > I think that the only way it will return a NAN is if passed a NAN. > > That seems to be the case but I was a little surprised to find that > > >>> math.atan2(INF, INF) > 0.7853981633974483 > > I would have expected NaN since atan2(INF, INF) could be thought of as > the limit of atan2(x, y) which could be any value in the range. And I'd > have guessed atan2(0, 0) would have been NaN too but > > >>> math.atan2(0, 0) > 0.0 In C, the result of atan2(0, 0) [for any sign of zero] may be implementation-dependent: "A domain error may occur if both arguments are zero." In CPython, though, they're explicitly handled as special cases by the m_atan2 function. The results match that of the x87 FPATAN instruction, and presumably the IEEE standard (the same results are prescribed in the IEC 60559 appendix of the C standard) http://www.charlespetzold.com/blog/2008/09/180741.html mentions Intel's rationale (in short, it's because 0+0j is a real number).
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-22 03:50 +1000
Re: Can math.atan2 return INF? pdorange@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) - 2016-06-21 20:01 +0200
Re: Can math.atan2 return INF? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-06-21 21:32 +0300
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-22 11:40 +1000
Re: Can math.atan2 return INF? Nagy László Zsolt <gandalf@shopzeus.com> - 2016-06-27 15:27 +0200
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-22 11:38 +1000
Re: Can math.atan2 return INF? pdorange@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) - 2016-06-22 08:21 +0200
Re: Can math.atan2 return INF? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-22 16:34 +0100
Re: Can math.atan2 return INF? Random832 <random832@fastmail.com> - 2016-06-22 12:19 -0400
Re: Can math.atan2 return INF? pdorange@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) - 2016-06-22 19:18 +0200
Re: Can math.atan2 return INF? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-22 20:17 +0100
Re: Can math.atan2 return INF? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-22 12:50 -0700
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-23 13:59 +1000
Re: Can math.atan2 return INF? Dan Sommers <dan@tombstonezero.net> - 2016-06-23 04:40 +0000
Re: Can math.atan2 return INF? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-06-23 16:45 +1000
Re: Can math.atan2 return INF? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-23 15:39 +0100
Re: Can math.atan2 return INF? alister <alister.ware@ntlworld.com> - 2016-06-23 15:04 +0000
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-24 02:44 +1000
Re: Can math.atan2 return INF? pdorange@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) - 2016-06-23 19:14 +0200
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-23 20:22 +0300
Re: Can math.atan2 return INF? pdorange@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) - 2016-06-24 09:53 +0200
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-24 13:38 +0300
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-26 11:43 +1200
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-26 11:40 +1200
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-26 10:09 +0300
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-27 11:08 +1200
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-27 12:59 +1000
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-27 09:40 +0300
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-27 06:15 -0700
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-27 16:45 +0300
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-27 07:01 -0700
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-27 17:12 +0300
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-27 07:27 -0700
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-27 20:03 +0300
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-28 18:12 +1200
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-27 23:25 -0700
Re: Can math.atan2 return INF? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-06-28 16:27 +1000
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-28 18:12 +1200
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-28 09:23 +0300
Re: Can math.atan2 return INF? Random832 <random832@fastmail.com> - 2016-06-28 09:39 -0400
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-06-29 01:22 +1000
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-28 19:36 +0300
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-28 19:42 +0300
Re: Can math.atan2 return INF? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-06-29 19:35 +1000
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-29 13:54 +0300
Re: Can math.atan2 return INF? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-29 18:33 -0700
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-29 19:13 -0700
Re: Can math.atan2 return INF? Chris Angelico <rosuav@gmail.com> - 2016-06-30 12:38 +1000
Re: Can math.atan2 return INF? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-06-30 18:24 +1000
Re: Can math.atan2 return INF? Andreas Röhler <andreas.roehler@online.de> - 2016-06-30 11:35 +0200
Re: Can math.atan2 return INF? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-30 02:42 -0700
Re: Can math.atan2 return INF? Andreas Röhler <andreas.roehler@online.de> - 2016-06-30 12:13 +0200
Re: Can math.atan2 return INF? Andreas Röhler <andreas.roehler@online.de> - 2016-06-30 12:11 +0200
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-07-01 03:18 +1000
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-30 08:28 -0700
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-07-01 04:03 +1000
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-07-01 07:19 -0700
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-07-01 18:20 +0300
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-07-29 22:46 -0700
Re: Can math.atan2 return INF? Steven D'Aprano <steve@pearwood.info> - 2016-08-01 12:53 +1000
Re: Can math.atan2 return INF? Paul Rubin <no.email@nospam.invalid> - 2016-07-31 20:41 -0700
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-07-31 20:54 -0700
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-07-31 21:05 -0700
Re: Can math.atan2 return INF? Ian Kelly <ian.g.kelly@gmail.com> - 2016-08-01 01:05 -0600
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-07-24 19:48 -0700
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-30 09:24 +0300
Re: Can math.atan2 return INF? Rustom Mody <rustompmody@gmail.com> - 2016-06-29 23:29 -0700
Re: Can math.atan2 return INF? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-06-30 07:47 -0400
Re: Can math.atan2 return INF? alister <alister.ware@ntlworld.com> - 2016-06-30 14:54 +0000
Re: Can math.atan2 return INF? Paul Rubin <no.email@nospam.invalid> - 2016-06-29 23:57 -0700
Re: Can math.atan2 return INF? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-30 00:16 -0700
Re: Can math.atan2 return INF? Paul Rubin <no.email@nospam.invalid> - 2016-06-30 00:32 -0700
Re: Can math.atan2 return INF? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-30 00:39 -0700
Re: Can math.atan2 return INF? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-06-30 18:27 +1000
Re: Can math.atan2 return INF? Andreas Röhler <andreas.roehler@online.de> - 2016-06-30 09:17 +0200
Re: Can math.atan2 return INF? Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-06-30 00:17 -0700
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-30 18:06 +1200
Re: Can math.atan2 return INF? Marko Rauhamaa <marko@pacujo.net> - 2016-06-30 09:32 +0300
Re: Can math.atan2 return INF? Random832 <random832@fastmail.com> - 2016-06-29 09:55 -0400
Re: Can math.atan2 return INF? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-06-26 11:15 +1200
Re: Can math.atan2 return INF? MRAB <python@mrabarnett.plus.com> - 2016-06-26 00:31 +0100
Re: Can math.atan2 return INF? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-23 20:04 +0100
Re: Can math.atan2 return INF? pdorange@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) - 2016-06-23 19:07 +0200
Re: Can math.atan2 return INF? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-06-23 15:37 +0100
csiph-web