| Author |
Comment/Response |
David Silverman
|
11/11/98 5:45pm
I'm writing a function that takes the first 2 numbers to the right of the decimal place and divides it by 60. For example, f[247.3]=.5, which is
30 divided by 60. I'm doing this by:
IntegerPart[100 FractionalPart[x]]/60
which I expected to work, but it gives me 29/60, probably because it is
using 29.99999999 instead of 30. I have noticed many times when I output
numbers to a file that are exact (e.g. 247.3) it will usually store it with
a bunch of 9's (e.g. 247.299999999). Is there a way to stop this? It is becoming
troublesome.
Thanks,
David
URL: , |
|