Re: debug.print 183 - 173.55



"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


.



Relevant Pages

  • Re: Ruby cant subtract ?
    ... On 28.10.2009 19:21, Matthew K. Williams wrote: ... That's a little strange.. ... Welcome to the wonderfully confusing world of floating ...
    (comp.lang.ruby)
  • Re: Bizarre Floating point errors in Ruby? Serious bug?
    ... I've come across a strange bug in ruby (running 1.8.6 on Linux, ... confirmed also in 1.8.5 on an older Mac). ... Is this a strange behaviour or what? ... I know a lot about floating point numbers, ...
    (comp.lang.ruby)
  • Re: Semi-OT: Alien Goo on North Slope
    ... Something big and strange is floating through the Chukchi Sea between ... Wainwright and Barrow. ...
    (sci.military.naval)
  • Bizarre Floating point errors in Ruby? Serious bug?
    ... I've come across a strange bug in ruby (running 1.8.6 on Linux, ... confirmed also in 1.8.5 on an older Mac). ... Is this a strange behaviour or what? ... I know a lot about floating point numbers, ...
    (comp.lang.ruby)
  • Re: Math Error in Query??
    ... Floating point numbers can store only a finite number of binary places, ... If you need no more than 4 decimal places, you could use the Currency type. ... THe Query takes that number ... When you mix singles and doubles, strange things can happen. ...
    (microsoft.public.access.queries)

Loading