Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
fp2025:lab02 [2025/03/05 15:49] pdmatei |
fp2025:lab02 [2025/03/05 17:03] (current) pdmatei |
||
---|---|---|---|
Line 84: | Line 84: | ||
</code> | </code> | ||
- | **2.8. (!) ** Try out your code for: ''2.0e50'' (which is $math[2.0\cdot 10^{50}]) or ''2.0e-50''. The code will likely take a very long time to finish. The reason is that $math[xn^2 - a] will suffer from rounding error which may be larger than 0.001. Can you find a different implementation for the function ''acceptable'' which takes that into account? (Hint: the code is just as simple as the original one). | + | **2.8. (!) ** Try out your code for: ''2.0e50'' (which is $math[2.0\cdot 10^{50}]) or ''2.0e-50''. The code will likely take a very long time to finish. The reason is that $math[x_n^2 - a] will suffer from rounding error which may be larger than 0.001. Can you find a different implementation for the function ''acceptable'' which takes that into account? (Hint: the code is just as simple as the original one). |