P
Peng Yu
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
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