seanm...@gmail.com wrote:
The explaination in my introductory Python book is not very
satisfying, and I am hoping someone can explain the following to me:
4 / 5.0
0.80000000000000004
4 / 5.0 is 0.8. No more, no less. So what's up with that 4 at the end.
It bothers me.
======================================
Machine architecture, actual implementation of logic on the chip and
what the compiler maker did all add up to creating rounding errors. I
have read where python, if left to its own, will output everything it
computed. I guess the idea is to show
1) python's accuracy and
2) what was left over
so the picky people can have something to gnaw on.
Astrophysics, Astronomers and like kind may have wants of such.
If you work much in finite math you may want to test the combo to see if
it will allow the accuracy you need. Or do you need to change machines?
Beyond that - just fix the money at 2, gas pumps at 3 and the
sine/cosine at 8 and let it ride. :)
Steve
--
http://mail.python.org/mailman/listinfo/python-list