RosettaCodeData/Task/Arithmetic-Integer/HicEst/arithmetic-integer-1.hicest

14 lines
720 B
Plaintext

DLG(Edit=A, Edit=B, TItle='Enter numeric A and B')
WRITE(Name) A, B
WRITE() ' A + B = ', A + B
WRITE() ' A - B = ', A - B
WRITE() ' A * B = ', A * B
WRITE() ' A / B = ', A / B ! no truncation
WRITE() 'truncate A / B = ', INT(A / B) ! truncates towards 0
WRITE() 'round next A / B = ', NINT(A / B) ! truncates towards next integer
WRITE() 'round down A / B = ', FLOOR(A / B) ! truncates towards minus infinity
WRITE() 'round up A / B = ', CEILING(A / B) ! truncates towards plus infinity
WRITE() 'remainder of A / B = ', MOD(A, B) ! same sign as A
WRITE() 'A to the power of B = ', A ^ B
WRITE() 'A to the power of B = ', A ** B