Floating point problem??
Use Double instead of Single. Single just doesn't have enough precision. See
VBA help for the limits of Data types
--
Kind regards,
Niek Otten
"Frederick Chow" wrote in message
...
Hi all,
I have a fairly mysterious problem.
It is hard to explain here, but basically what I did is declare a variable
X as single, then assign a cell content containing decimal digits to X,
then write X back to another cell.
Problem is, let say, suppose the original cell contains 0.0111773. After
transferring this number to X and then copy back to another cell, that
cell now contains 0.0111772995442152. Though the cell content is very near
to the original one, but it does cause problem to me. Anybody can guess
what actually happened and what is the solution? Thanks a lot.
Frederick Chow
|