finding out the precision of floats
Robert Kern
robert.kern at gmail.com
Sun Feb 25 15:28:19 EST 2007
John Machin wrote:
> Evidently not; here's some documentation we both need(ed) to read:
>
> http://docs.python.org/tut/node16.html
> """
> Almost all machines today (November 2000) use IEEE-754 floating point
> arithmetic, and almost all platforms map Python floats to IEEE-754
> "double precision".
> """
> I'm very curious to know what the exceptions were in November 2000 and
> if they still exist.
All Python interpreters use whatever is the C double type on its platform to
represent floats. Not all of the platforms use *IEEE-754* floating point types.
The most notable and still relevant example that I know of is Cray.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-list
mailing list