4 ms·
C, Julia, Python, Maxima, Mathematica, ChatGPT and Numerical Errors
- npalli 3y agoNot sure what the poster is getting at. It seems to be 'normal' case of precision with floating point. In Julia for example, you can define u to be BigFloat (defaulting to 32 bytes for me below). It gets you the correct answer. The python and other default versions of other software are definitely not the "right" answer. julia> u::BigFloat = 5.0; julia> for i=0:72 u = 6.0*cos(u) end julia> print(u) 2.77675840848277346491725024972478163010030433082748210024033940771878181653911