Strange behaviour with numbers in exponential notation

Marco Sulla marco.sulla.python.mailing at gmail.com
Fri Sep 2 13:24:46 EDT 2016


Excuse me, I forgot to include the python list mail addess. I repost the mail.



 On Fri, Sep 2, 2016 at 6:18 PM, Christian Gollwitzer <auriocus at gmx.de> wrote:
> 1e26 denotes a *floating point number* Floating point has finite precision,
> in CPython it is a 64bit IEEE number. The largest exact integer there is
> 2**53 (~10^16), everything beyond cannot be accurately represented.

I see. So python float type is the IEEE 754 double. Why is it not
automatically converted to long double?

And I want to add to my original question: indeed I read from the docs:
https://docs.python.org/3/reference/lexical_analysis.html#floating-point-literals
that float has an 'exponentfloat' syntax. Why integers does not have
an equivalent syntax? It's not too difficult to lexically distinguish
between a integer and a float written in exponential notation, I
think.



More information about the Python-list mailing list