Am 05.06.2012 17:03, schrieb Brian Blais:
one small question: why did you change g=-9.8 to g=-Rational(98,10)?
does that make the analysis easier for sympy?  is there some reason
to avoid floats?

Yes: 9.8 cannot be represented exactly in a machine float, it gets rounded.
In this case, this in itself isn't a problem, the round-off error is orders of magnitudes smaller than the variance of g. However, different machine architectures might implement the rounding differently. There is a lot of nitty-gritty details about rounding, and Python doesn't even attempt to control them. Which means that if you run the program on a different machine, you may get different results. Which is bad in a number of scenarios.

With Rational(98,10), this kind of thing doesn't happen because it's using two integers and the division is never actually carried out.

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to