Arithmetic/Integer: Difference between revisions
Content added Content deleted
(→{{header|AWK}}: amigae) |
No edit summary |
||
Line 63: | Line 63: | ||
WriteF('A mod B =\d\n', Mod(a,b)) |
WriteF('A mod B =\d\n', Mod(a,b)) |
||
ENDPROC</lang> |
ENDPROC</lang> |
||
=={{header|AutoHotkey}}== |
|||
The quotient rounds towards 0 if both inputs are integers or towards negative infinity if either input is floating point. The sign of the remainder is always the same as the sign of the first parameter. |
|||
<lang autohotkey>Gui, Add, Edit, va, 5 |
|||
Gui, Add, Edit, vb, -3 |
|||
Gui, Add, Button, Default, Compute |
|||
Gui, Show |
|||
return |
|||
ButtonCompute: |
|||
Gui, Submit |
|||
MsgBox,% |
|||
(Join`s"`n" |
|||
a "+" b " = " a+b |
|||
a "-" b " = " a-b |
|||
a "*" b " = " a*b |
|||
a "//" b " = " a//b " remainder " Mod(a,b) |
|||
a "**" b " = " a**b |
|||
) |
|||
GuiClose: |
|||
ExitApp</lang> |
|||
=={{header|AWK}}== |
=={{header|AWK}}== |