TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

C, Julia, Python, Maxima, Mathematica, ChatGPT and Numerical Errors

5 pointsby nomilkover 1 year ago

1 comment

npalliover 1 year ago
Not sure what the poster is getting at. It seems to be &#x27;normal&#x27; 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 &quot;right&quot; answer.<p><pre><code> julia&gt; u::BigFloat = 5.0; julia&gt; for i=0:72 u = 6.0*cos(u) end julia&gt; print(u) 2.77675840848277346491725024972478163010030433082748210024033940771878181653911</code></pre>