This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,15 @@
count = "3" /*typeless variables are all character strings.*/
count = 3 /*(same as above)*/
count = count + 1 /*variables in a numerical context are treated as numbers.*/
say count
/*------------------ 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 a "five". */
say 'count=' count /*ya most likely don't want to display this thing*/

View file

@ -0,0 +1,36 @@
/* REXX ************************************************************
* 11.12.2012 Walter Pachl
* 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')