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.) |
m (→A sequence that seems to converge to a wrong limit: moved some comments around.) |
||
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.*/ |
||
⚫ | |||
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*/ /* |
end /*n*/ /*stick a fork in it, we're all done. */</lang> |
||
⚫ | |||
{{out|output|text= when using the default inputs:}} |
{{out|output|text= when using the default inputs:}} |
||
<pre> |
<pre> |