Peng Yu
unread,Jul 6, 2012, 6:38:38 PM7/6/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
Out[2]: 0.9999999999999999
In ipython, I got the above output. But I got a different output from
"print". Is there a way to print exact what I saw in ipython?
~/linux/test/python/man/library/math/fsum$ cat main.py
#!/usr/bin/env python
print sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
~/linux/test/python/man/library/math/fsum$ ./main.py
1.0
Regards,
Peng