[Tutor] Here's some interesting float oddness.

Adam adam.jtm30 at gmail.com
Tue Jun 27 00:41:22 CEST 2006


I tried this expecting an exception

In [2]: math.tan(math.pi/2)
Out[2]: 16331778728383844.0

so I thought maybe that was a float limit which it probably is as you get
weird results from higher values but it seems strange that it tries to run
with it.

In [5]: 16331778728383844.0
Out[5]: 16331778728383844.0

In [6]: 16331778728383845.0
Out[6]: 16331778728383844.0

In [7]: 16331778728383846.0
Out[7]: 16331778728383846.0

In [8]: 16331778728383845.0
Out[8]: 16331778728383844.0

In [9]: 16331778728383847.0
Out[9]: 16331778728383848.0

In [10]: 16331778728383848.0
Out[10]: 16331778728383848.0

weird huh?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060626/a47a4dfa/attachment.htm 


More information about the Tutor mailing list