newb: Python Floating Point

Robert Kern robert.kern at gmail.com
Thu Mar 15 20:49:36 EDT 2007


johnny wrote:
> When I do the following, rounding to 2 decimal places doesn't seem to
> work.  I should get 0.99 :
> 
>>>> a =0.99
>>>> a
> 0.98999999999999999
>>>> round(a,2)
> 0.98999999999999999

http://docs.python.org/tut/node16.html

-- 
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