Can math.atan2 return INF?

Pierre-Alain Dorange pdorange at
Wed Jun 22 02:21:02 EDT 2016

Steven D'Aprano <steve at> wrote:

> py> math.atan2(NAN, 0)
> nan
> I think that the only way it will return a NAN is if passed a NAN.

yes of course if you pass an invalid argument (NAN is not a real value,
atan2 except coordinate x,y), the result would be invalid...

Pierre-Alain Dorange        <>

Ce message est sous licence Creative Commons "by-nc-sa-2.0"

More information about the Python-list mailing list