Re: debug.print 183 - 173.55
- From: "xgold" <xanghel@xxxxxxxxx>
- Date: Wed, 29 Nov 2006 03:59:12 +0200
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 messagehttp://groups.google.com.my/group/microsoft.public.vb.general.discussion/msg
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
/74b7abbe3645bd1b
--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
.
- Follow-Ups:
- Re: debug.print 183 - 173.55
- From: Robert Morley
- Re: debug.print 183 - 173.55
- References:
- debug.print 183 - 173.55
- From: xgold
- Re: debug.print 183 - 173.55
- From: Ken Halter
- debug.print 183 - 173.55
- Prev by Date: Re: debug.print 183 - 173.55
- Next by Date: Re: UpDown Control(s) turns into PictureBox(s)
- Previous by thread: Re: debug.print 183 - 173.55
- Next by thread: Re: debug.print 183 - 173.55
- Index(es):
Loading