Can math.atan2 return INF?

Steven D'Aprano steve at pearwood.info
Tue Jun 21 21:40:45 EDT 2016


On Wed, 22 Jun 2016 04:32 am, Jussi Piitulainen wrote:

> pdorange at pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes:
> 
>> Steven D'Aprano <steve at pearwood.info> wrote:
>>
>>> Are there any circumstances where math.atan2(a, b) can return an
>>> infinity?
[...]
> I didn't see any mention of it ever being infinite, which makes sense
> given that arcus functions are supposed to return angles. The extreme
> case seemed to be the inclusion of -pi as a possible value.
> 
> (I know nothing, I was just curious enough to play with this a bit.)

Thanks, I'm in the same position as you, except that I'm in the position
where I need it use the result, and if it ever returns INF my function will
blow up. But it doesn't look like that can happen.



-- 
Steven




More information about the Python-list mailing list