Arithmetic/Integer: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 1,069: | Line 1,069: | ||
Exponentiation is also a base arithmetic operation in Groovy, so: |
Exponentiation is also a base arithmetic operation in Groovy, so: |
||
a ** b = 5 ** 3 = 125</pre> |
a ** b = 5 ** 3 = 125</pre> |
||
=={{header|Harbour}}== |
|||
<lang harbour>Function( a, b ) |
|||
? "a+b", a + b |
|||
? "a-b", a - b |
|||
? "a*b", a * b |
|||
// The quotient isn't integer, so we use the Int() function, which truncates it downward. |
|||
? "a/b", Int( a / b ) |
|||
// Remainder: |
|||
? "a%b", a % b |
|||
// Exponentiation is also a base arithmetic operation |
|||
? "a**b", a ** b |
|||
Return Nil</lang> |
|||
=={{header|Haskell}}== |
=={{header|Haskell}}== |