[Tutor] Rounding

Terje Johan Abrahamsen terjeja@hotmail.com
Wed, 29 May 2002 20:03:39 +0000


I am trying to use the round() function. But, it doesn't give me the answers 
I want:

>>>g = 44.444444
>>>g
44.444443999999997
>>>round(g,2)
44.439999999999998
>>>round(g,9)
44.444443999999997
>>>round(g, 2)
44.439999999999998
>>>round(3333.33333, 2)
3333.3299999999999
>>>round(12.345)
12.0
>>>round(12.345, 2)
12.35
>>>round(43.43445353, 2)
43.43
>>>g
44.444443999999997
>>>round(g, 2)
44.439999999999998


Sometimes it works as I want it to work. Other times it doesn't. And why did 
g become 44.444443999999997, instead of 44.444444 as I typed it in as in the 
beginning? Can anyone explain for me?

Thanks in advance,
Terje

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx