Can math.atan2 return INF?

Ben Bacarisse ben.usenet at bsb.me.uk
Thu Jun 23 15:04:36 EDT 2016


alister <alister.ware at ntlworld.com> writes:

> On Thu, 23 Jun 2016 15:39:43 +0100, Ben Bacarisse wrote:
>
>> Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
>> 
>>> On Thursday 23 June 2016 14:40, Dan Sommers wrote:
>>>
>>>>> Since x == y, the answer should be the same as for any other pair of
>>>>> x == y.
>>>> 
>>>> When x == y == 0, then atan2(y, x) is 0.
>> 
>> I see just added noise by making the same comment before reading the
>> rest of the thread.  Sorry.
>> 
>>> /s/any other pair of x == y/any other pair of x y except for zero/
>>>
>>> :-P
>>>
>>>
>>> Zero is exceptional in many ways.
>> 
>> whereas infinity...  :-)
>
> which infinity. There are many - some larger than others

The one in the post up thread now (sadly) snipped.  It's not a
mathematical infinity at all but a particular floating point
representation that results from float("inf").  However it is still just
as "exceptional in many ways" as zero.  (Sorry if you were making a joke
and I didn't get it.)

-- 
Ben.



More information about the Python-list mailing list