Advanced computing with IPython
Advanced computing with IPython
Posted Jun 20, 2018 18:22 UTC (Wed) by excors (subscriber, #95769)In reply to: Advanced computing with IPython by yroyon
Parent article: Advanced computing with IPython
They should both be using double-precision floats, and should calculate 1+1/1e8 identically. But the ** operator is much more complicated and can be implemented in many different ways with different levels of accuracy and performance. I guess Python probably uses pow() from the C standard library, so might not even give the same answer if you run it on Windows, and the Fortran compiler presumably has its own implementation. So it's more a consequence of their maths libraries than of the language itself, exacerbated by doing a silly computation .