Re: debug.print 183 - 173.55




hmm strange problem , i didnt knew about that, i solved the problem using
the round function round(c,2) , ty.


"Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ufNcIR0EHHA.3600@xxxxxxxxxxxxxxxxxxxxxxx
"xgold" <xanghel@xxxxxxxxx> wrote in message
news:OrXGEtzEHHA.4404@xxxxxxxxxxxxxxxxxxxxxxx
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

This question is as old as floating point math itself

if you try this with windows standard calculator it gives the right
answer.


The Calculator knows how to work with floating point numbers.

Weird floating point problem

http://groups.google.com.my/group/microsoft.public.vb.general.discussion/msg
/74b7abbe3645bd1b

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm




.


Loading