Click to See Complete Forum and Search --> : Doubles and Ghost-Decimals


Loh
December 24th, 1998, 07:57 AM
Compute the following (it's an example, other numbers do the same) :

346.48 - 346

The result may not compare with the user-input value 0.48 :


because 346.48 - 346 does not give 0.48 but something like 0.48000000000018 (not sure for how much zeros)...


any comment/idea ?

CrazyD
December 24th, 1998, 11:30 AM
Hi

If you convert the result to a single with CSng() the result will be 0.48, so the comparison will be fine.

I've tested it with some other values too, and it worked fine with me.


Hope this helps


Crazy D