Libraries anvil lang op

namespace op
Set of functions which behave same as the corresponding operators.

Functions

add(..)
Adds parameters togethers

int and(..)

Returns the result of binary arithmetic AND.
Returns Result of binary AND.

int cmp(object a, object b)
Compares parameters.
Returns -1 if ab.

int compareTo(object a, object b)
Compares parameters.
Returns -1 if ab.

div(..)
Performs division: n1 / n2 / n2 ...

list divmod(object a, object b)
Performs division operation with parameters and returns result of division and remainder.
Returns List (divisionResult, remainder)

boolean eq(a, b)
Performs equality check.

boolean equals(object a, object b)
Compares parameters.
Returns true if a==b, false otherwise.

boolean ge(a, b)
Performs greater than or equal to check.

boolean gt(a, b)
Performs greater than check.

boolean le(a, b)
Performs less than or equal to check.

boolean lt(a, b)
Performs less than check.

mod(..)
Performs remainder: n1 % n2 % n2 ...

mul(..)
Multiplies parameters.

boolean ne(a, b)
Performs non equality check.

int neg(int a)
Returns the result of logical negation.
Returns Result of logical negation.

int or(..)

Returns the result of binary arithmetic OR.
Returns Result of binary OR.

int shift(int a, int amount)
Shifts the parameter to left or right for given amount.
Parameters amount -  Left shift if positive, right shift if negative.
Returns Result of shift.

sub(..)
Performs subtraction: n1 - n2 - n2 ...

xor(object a, object b, ...)

Returns the result of logical xor.
Returns Result of logical xor.