Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,24 +1,22 @@
/*REXX program obtains two integers from the C.L. (a prompt); displays some operations.*/
numeric digits 20 /*#s are round at 20th significant dig.*/
parse arg x y . /*maybe the integers are on the C.L. */
-- 24 Sep 2025
include Setting
do while \datatype(x,'W') | \datatype(y,'W') /*both X and Y must be integers. */
say "─────Enter two integer values (separated by blanks):"
parse pull x y . /*accept two thingys from command line.*/
end /*while*/
/* [↓] perform this DO loop twice. */
do j=1 for 2 /*show A oper B, then B oper A.*/
call show 'addition' , "+", x+y
call show 'subtraction' , "-", x-y
call show 'multiplication' , "*", x*y
call show 'int division' , "%", x%y, ' [rounds down]'
call show 'real division' , "/", x/y
call show 'division remainder', "//", x//y, ' [sign from 1st operand]'
call show 'power' , "**", x**y
say 'ARITHMETIC - INTEGER'
say version
say
arg x','y
if x='' then
x=3
if y='' then
y=7
say 'All supported operations on integers...'
say 'Addition x+y = ' x+y
say 'Subtraction x-y = ' x-y
say 'Multiplication x*y = ' x*y
say 'Integer division x%y = ' x%y '(rounds towards zero)'
say 'Real division x/y = ' x/y '(might be floating point)'
say 'Remainder x//y =' x//y
say 'Exponentiation x**y =' x**y '(might be floating point)'
exit
parse value x y with y x /*swap the two values and perform again*/
if j==1 then say copies('', 79) /*display a fence after the 1st round. */
end /*j*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
show: parse arg c,o,#,?; say right(c,25)' ' x center(o,4) y " ───► " # ?; return
include Math