2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,5 +1,5 @@
/*REXX pgm displays values when integers have an overflow or underflow.*/
numeric digits 9 /*default is nine decimal digits.*/
/*REXX program displays values when integers have an overflow or underflow. */
numeric digits 9 /*the REXX default is 9 decimal digits.*/
call showResult( 999999997 + 1 )
call showResult( 999999998 + 1 )
call showResult( 999999999 + 1 )
@ -7,10 +7,10 @@ call showResult( -999999998 - 2 )
call showResult( 40000 * 25000 )
call showResult( -50000 * 20000 )
call showResult( 50000 *-30000 )
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────SHOWRESULT subroutine───────────────*/
showResult: procedure; parse arg x,,_; x=x/1 /*normalize X. */
if pos('E',x)\==0 then if x>0 then _=' [overflow]' /*did it ↑flow?*/
else _=' [underflow]' /*did it ↓flow?*/
say right(x,20) _ /*show result. */
return x /*return value.*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
showResult: procedure; parse arg x,,_; x=x/1 /*normalize X. */
if pos(., x)\==0 then if x>0 then _=' [overflow]' /*did it overflow? */
else _=' [underflow]' /*did it underflow? */
say right(x, 20) _ /*show the result. */
return x /*return the value. */