Anonymous user
Arithmetic/Integer: Difference between revisions
→{{header|REXX}}: corrected statement about the sign of the remainder, added much whitespace in program and output. -- ~~~~
Capra Hircus (talk | contribs) (adding maxima) |
(→{{header|REXX}}: corrected statement about the sign of the remainder, added much whitespace in program and output. -- ~~~~) |
||
Line 1,928:
=={{header|REXX}}==
<lang rexx>/*REXX pgm gets 2 integers from the console and displays various results*/
pad=left('',20) /*used for indenting the output. */
say "enter 2 integer values separated by blanks"▼
yields=' ───► ' /*use this to show "yields". */
say a "+" b "=" a+b▼
say /*add a blank line to the output.*/
say a "-" b "=" a-b▼
say a "*" b "=" a*b▼
say a "/" b "=" a%b "remaining" a//b "(sign from first operand)"▼
parse pull a b . /*or, could use: PULL A B . */
say a "^" b "=" a**b</lang>▼
say /*add a blank line to the output.*/
'''output'''
<pre>
17 -4
17 + -4 ───► 13
17 - -4 ───► 21
17 * -4 ───► -68
17 / -4
17 ** -4 ───► 0.0000119730367
</pre>
=={{header|Ruby}}==
|