Pathological floating point problems: Difference between revisions

Content added Content deleted
m (→‎A sequence that seems to converge to a wrong limit: changed a comment and whitespace.)
Line 2,220: Line 2,220:
do n=3 to fin; nm1= n-1; nm2= n-2 /*compute some values of the V elements*/
do n=3 to fin; nm1= n-1; nm2= n-2 /*compute some values of the V elements*/
v.n= 111 - 1130/v.nm1 + 3000/(v.nm1*v.nm2) /* " a value of a " element.*/
v.n= 111 - 1130/v.nm1 + 3000/(v.nm1*v.nm2) /* " a value of a " element.*/
/*display digs past the dec. point───┐ */
if wordpos(n, #)\==0 then say 'v.'left(n, w) "=" format(v.n, , show)
if wordpos(n, #)\==0 then say 'v.'left(n, w) "=" format(v.n, , show)
end /*n*/ /*display digs past the dec. point───┘ */
end /*n*/ /*stick a fork in it, we're all done. */</lang>
/*stick a fork in it, we're all done. */</lang>
{{out|output|text=&nbsp; when using the default inputs:}}
{{out|output|text=&nbsp; when using the default inputs:}}
<pre>
<pre>