|
-
December 24th, 1998, 08:57 AM
#1
Doubles and Ghost-Decimals
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 ?
-
December 24th, 1998, 12:30 PM
#2
Re: Doubles and Ghost-Decimals
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|