Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Accuracy question' topicStudent Support Forum > General > "Accuracy question"

Next Comment >Help | Reply To Topic
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



URL: ,

Subject (listing for 'Accuracy question')
Author Date Posted
Accuracy question David Silver... 11/11/98 5:45pm
Re: Accuracy question Aaron Honec... 11/13/98 10:23am
Re: Accuracy question david silver... 11/22/98 09:27am
Re: Accuracy question Forum Modera... 11/22/98 10:50am
Next Comment >Help | Reply To Topic