Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
/*REXX program demonstrates a method how to increment a numerical string*/
|
||||
count = "3" /*REXX variables (and constants) are character strings.*/
|
||||
count = 3 /*(identical to the above statement.) */
|
||||
count = count+1 /*strings in a numerical context are treated as numbers*/
|
||||
say 'sum=' count /*display the value of COUNT to the terminal (screen)*/
|
||||
|
||||
/*────────────────── The default numeric digits for REXX is 9 digits. */
|
||||
/*────────────────── However, that can be increased with NUMERIC DIGITS.*/
|
||||
|
||||
numeric digits 15000 /*let's go ka-razy with fifteen thousand digits. */
|
||||
|
||||
count=copies(2,15000) /*stressing REXX's brains with lots of two's, */
|
||||
/*the above is considered a number in REXX. */
|
||||
count=count+3 /*make that last digit of COUNT a "5". */
|
||||
|
||||
if 1==0 then /*let's not display this gihugeic number to term,*/
|
||||
say 'count=' count /*ya most likely don't want to display this thing*/
|
||||
|
||||
/* [↓] show the six leftmost and rightmost digs.*/
|
||||
say 'count=' left(count,6)'···'right(count,6)
|
||||
/*stick a fork in it, we're done.*/
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* REXX ************************************************************
|
||||
* There is no equivalent to PL/I's SIZE condition in REXX.
|
||||
* The result of an arithmetic expression is rounded
|
||||
* according to the current setting of Numeric Digits.
|
||||
* ooRexx introduced, however, a LOSTDIGITS condition that checks
|
||||
* if any of the OPERANDS exceeds this number of digits.
|
||||
* Unfortunately this check is currently a little too weak
|
||||
* and will not recognise a 10-digit number to be too large.
|
||||
* This little bug will be fixed in the next release of ooRexx.
|
||||
**********************************************************************/
|
||||
Parse Version v .
|
||||
Say v
|
||||
z=999999998
|
||||
Do i=1 To 3
|
||||
z=z+1
|
||||
Say z
|
||||
End
|
||||
Numeric Digits 20
|
||||
z=999999998
|
||||
Do i=1 To 3
|
||||
z=z+1
|
||||
Say z
|
||||
End
|
||||
Numeric Digits 9
|
||||
If left(v,11)='REXX-ooRexx' Then
|
||||
Signal On Lostdigits
|
||||
z=100000000012
|
||||
Say z
|
||||
z=z+1
|
||||
Say z
|
||||
Exit
|
||||
lostdigits:
|
||||
Say 'LOSTDIGITS condition raised in line' sigl
|
||||
Say 'sourceline='sourceline(sigl)
|
||||
Say "condition('D')="condition('D')
|
||||
Loading…
Add table
Add a link
Reference in a new issue