Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
/*REXX pgm (pathological FP problem): a sequence that might converge to a wrong limit. */
|
||||
parse arg digs show . /*obtain optional arguments from the CL*/
|
||||
if digs=='' | digs=="," then digs= 150 /*Not specified? Then use the default.*/
|
||||
if show=='' | show=="," then show= 20 /* " " " " " " */
|
||||
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(#) ) /*find the last (largest) index number.*/
|
||||
w= length(fin) /* " " length (in dec digs) of FIN.*/
|
||||
v.1= 2 /*the value of the first V element. */
|
||||
v.2=-4 /* " " " " second " " */
|
||||
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.*/
|
||||
/*display digs past the dec. point───┐ */
|
||||
if wordpos(n, #)\==0 then say 'v.'left(n, w) "=" format(v.n, , show)
|
||||
end /*n*/ /*stick a fork in it, we're all done. */
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
/*REXX pgm (pathological FP problem): the chaotic bank society offering a new investment*/
|
||||
e=2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713,
|
||||
||8217852516642742746639193200305992181741359662904357290033429526059563073813232862794,
|
||||
||3490763233829880753195251019011573834187930702154089149934884167509244761460668082264,
|
||||
||8001684774118537423454424371075390777449920695517027618386062613313845830007520449338
|
||||
d = length(e) - length(.) /*subtract one for the decimal point. */
|
||||
parse arg digs show y . /*obtain optional arguments from the CL*/
|
||||
if digs=='' | digs=="," then digs= d /*Not specified? Then use the default.*/
|
||||
if show=='' | show=="," then show= 20 /* " " " " " " */
|
||||
if y=='' | y=="," then y= 25 /* " " " " " " */
|
||||
numeric digits digs /*have REXX use "digs" decimal digits. */
|
||||
$= e - 1 /*subtract $1 from e, that's da deposit*/
|
||||
/* [↑] value of newly opened account. */
|
||||
do n=1 for y /*compute the value of the account/year*/
|
||||
$= $*n - 1 /* " " " " " account now.*/
|
||||
end /*n*/
|
||||
@@@= 'With ' d " decimal digits, the balance after " y ' years is: '
|
||||
say @@@ '$'format($, , show) / 1 /*stick a fork in it, we're all done. */
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
/*REXX pgm (pathological FP problem): the Siegfried Rump's example (problem dated 1988).*/
|
||||
parse arg digs show . /*obtain optional arguments from the CL*/
|
||||
if digs=='' | digs=="," then digs=150 /*Not specified? Then use the default.*/
|
||||
if show=='' | show=="," then show= 20 /* " " " " " " */
|
||||
numeric digits digs /*have REXX use "digs" decimal digits. */
|
||||
a= 77617.0 /*initialize A to it's defined value.*/
|
||||
b= 33096.0 /* " B " " " " */
|
||||
/*display SHOW digits past the dec. pt.*/
|
||||
say 'f(a,b)=' format( f(a,b), , show) /*display result from the F function.*/
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
f: procedure; parse arg a,b; return 333.75* b**6 + a**2 * (11* a**2* b**2 - b**6,
|
||||
- 121*b**4 - 2) + 5.5*b**8 + a / (2*b)
|
||||
Loading…
Add table
Add a link
Reference in a new issue