Operator Performs + Addition - Subtraction * Multiplication / Division mod Get the remainder rem Get the remainder, Sign of the result is same as sign of x. ^ Calculates power, a^x return a to the power x.

`*Main> let a = 10*Main> let b = 5*Main> *Main> a + b15*Main> *Main> a - b5*Main> *Main> a * b50*Main> *Main> a / b2.0*Main> *Main> mod a b0*Main> *Main> mod b a5*Main> *Main> rem a b0*Main> *Main> rem b a5*Main> *Main> a ^ b100000*Main> *Main> b ^ a9765625`

As you observe, I used mod, rem operators in prefix form. By using `backtics`, you can use mod and rem operators in infix notation.

`*Main> 10 `mod` 31*Main> 10 `rem` 31`

Always surround negative numbers in parenthesis, other wise you will end up in following kind of error.
`*Main> 10 / -3<interactive>:86:1:Precedence parsing error        cannot mix ‘/’ [infixl 7] and prefix `-' [infixl 6] in the same infix expression`

To solve above problem, we need to put negative number in parenthesis like below.

This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here