Jump to content

Pathological floating point problems: Difference between revisions

Line 1,253:
 
===Task 2: Chaotic Bank Society===
AC) Unlike Ruby, had to manually create "E" to sufficient precision.
<lang Ruby>require "big"
 
Line 1,276:
<pre>Bank balance after 25 years = 0.03993872967323021</pre>
 
BD) Or from Factor, use large rational approximation for "E = 106246577894593683 / 39085931702241241".
<lang Ruby>require "big"
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.