Anonymous user
Pathological floating point problems: Difference between revisions
Pathological floating point problems (view source)
Revision as of 03:41, 18 September 2018
, 5 years ago→A sequence that seems to converge to a wrong limit: changed a comment and whitespace.
m (→{{header|REXX}}: used a template for the output sections.) |
m (→A sequence that seems to converge to a wrong limit: changed a comment and whitespace.) |
||
Line 2,208:
<br>calculations, as well how many decimal digits (past the decimal point) should be displayed.
===A sequence that seems to converge to a wrong limit===
<lang rexx>/*REXX pgm (pathological FP problem): a sequence that
parse arg digs show . /*obtain optional arguments from the CL*/
if digs=='' | digs=="," then digs=
if show=='' | show=="," then show=
numeric digits digs /*have REXX use "digs" decimal digits. */
#= 2 4 5 6 7 8 9 20 30 50 100 /*the indices to display value of V.n */
fin= word(#, words(#) )
w= length(fin)
v.1= 2 /*the value of the first V element. */
v.2=-4 /* " " " " second " " */
/*stick a fork in it, we're all done. */</lang>
{{out|output|text= when using the default inputs:}}
|