farsi...@gmail.com wrote:
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
I have 1 more question that the floating point article that was linked
farsi...@gmail.com wrote:
4 / 5.0
0.84
0.8 * 5
4.0
Start here:
http://docs.python.org/tutorial/floatingpoint.html
Play with these:
4/5.0
0.84
print 4/5.0
0.8
print repr(4/5.0)
0.84
str(4/5.0)
'0.8'
repr(4/5.0)
'0.80004'
Duncan Booth wrote:
farsi...@gmail.com wrote:
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
Try to remember though that the decimal module
4 / 5.0
0.84
0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
--
http://mail.python.org/mailman/listinfo/python-list
: Sunday, March 8, 2009 4:16:53 PM
Subject: 2.6.1 - simple division
4 / 5.0
0.84
0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list
2009/3/8 farsi...@gmail.com:
4 / 5.0
0.84
0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
I know this has already been answered in detail, but one thing that
it's easy for those new to floating point issues to miss is that
fractions that can be expressed
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84 0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following:
40 / 5.0
8.0
Strange...
--
http://mail.python.org/mailman/listinfo/python-list
En Sun, 08 Mar 2009 12:22:50 -0200, farsi...@gmail.com escribió:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84
0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following:
40 / 5.0
8.0
Strange...
See
farsi...@gmail.com wrote:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84
This one is a common FAQ. Basically floating point is never to be
trusted. This issue is quite language agnostic, however some language
decided to hide the issue, python does not. For more
On Mar 8, 7:22 pm, farsi...@gmail.com wrote:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84 0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following: 40 / 5.0
8.0
Strange...
Please see
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
I have 1 more question that the floating point article that was linked
didn't really answer:
x =
farsi...@gmail.com wrote:
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
Try to remember though that the decimal module simply replaces one
Thanks duncan, thats very helpful. I'll be more careful with floating
point numbers in future.
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo