Arithmetic/Integer: Difference between revisions
Content added Content deleted
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: | Line 1,928: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
<lang rexx>/*REXX*/ |
<lang rexx>/*REXX pgm gets 2 integers from the console and displays various results*/ |
||
pad=left('',20) /*used for indenting the output. */ |
|||
⚫ | |||
yields=' ───► ' /*use this to show "yields". */ |
|||
parse pull a b |
|||
⚫ | |||
say /*add a blank line to the output.*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
parse pull a b . /*or, could use: PULL A B . */ |
|||
⚫ | |||
say /*add a blank line to the output.*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
'''output''' |
'''output''' |
||
<pre> |
|||
Enter two integer values (separated by blanks): |
|||
17 -4 |
17 -4 |
||
17 + -4 = 13 |
|||
17 + -4 ───► 13 |
|||
17 - -4 = 21 |
|||
17 - -4 ───► 21 |
|||
17 * -4 = -68 |
|||
17 * -4 ───► -68 |
|||
17 / -4 |
17 / -4 ───► -4 remaining 1 (sign from 2nd operand) |
||
17 ^ -4 = 0.0000119730367</pre> |
|||
17 ** -4 ───► 0.0000119730367 |
|||
</pre> |
|||
=={{header|Ruby}}== |
=={{header|Ruby}}== |