xgold
2006-11-28 22:19:40 UTC
i have visual basig 6
if i type in the debug window it gives me a strange result
debug.print 183 - 173.55
9.44999999999999
why this result instead of 9.45
the same is happening if i do
a = 183
b = 173.55
c = a-b
debug.print c
if i do 183 - 174.55 or 183 - 180.55 the same strange thing happen. ( with
.449999999 instead of .45 )why and how to avoid this?
if you try this with windows standard calculator it gives the right answer.
ty
if i type in the debug window it gives me a strange result
debug.print 183 - 173.55
9.44999999999999
why this result instead of 9.45
the same is happening if i do
a = 183
b = 173.55
c = a-b
debug.print c
if i do 183 - 174.55 or 183 - 180.55 the same strange thing happen. ( with
.449999999 instead of .45 )why and how to avoid this?
if you try this with windows standard calculator it gives the right answer.
ty