class Operation

This class provides static functions that perform logical or arithmetic operations

Methods

static void
plus(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of adding two numbers, a date and a number of days, or the concatenation of two strings.

static void
minus(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of subtracting two numbers or a date and a number of days.

static void
times(Token $arg1, Token $arg2, Token $result)

Calculates and returns the product of two numbers.

static void
div(Token $arg1, Token $arg2, Token $result)

Calculates and returns the quotient of the Euclidean division of one number by another.

static void
mod(Token $arg1, Token $arg2, Token $result)

Calculates and returns the remainder of the Euclidean division of one number by another.

static void
pow(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the first operand raised to the power of the operand.

static void
bitwiseAnd(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the bitwise AND on the two given operands.

static void
bitwiseXor(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the bitwise XOR on the two given operands.

static void
bitwiseOr(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the bitwise OR on the two given operands.

static void
logicalAnd(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the logical AND on the two given operands.

static void
logicalOr(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the logical OR on the two given operands.

static void
unaryPlus(Token $arg1, Token $result)

Calculates and returns the result of the unary positive operation on the given operand.

static void
unaryMinus(Token $arg1, Token $result)

Calculates and returns the result of the unary negation on the given operand.

static void
not(Token $arg1, Token $result)

Calculates and returns the result of the logical negation on the given operand.

static void
degre(Token $arg1, Token $result)

Converts a number expressed in radians to a number expressed in degrees

static void
ternaryElse(Token $arg1, Token $result)

Transfers the argument into the result token (for the else part of a ternary operation)

static void
ternary(Token $arg1, Token $arg2, Token $arg3, Token $result)

Evaluates the first argument, if true the result is the second argument otherwise the result is the third argument

Details

at line 50
static void plus(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of adding two numbers, a date and a number of days, or the concatenation of two strings.

.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the addition

Return Value

void

Exceptions

Exception

at line 108
static void minus(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of subtracting two numbers or a date and a number of days.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the subtraction

Return Value

void

Exceptions

Exception

at line 150
static void times(Token $arg1, Token $arg2, Token $result)

Calculates and returns the product of two numbers.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the first operand
Token $result &$result The token containing the result of the product

Return Value

void

Exceptions

Exception

at line 173
static void div(Token $arg1, Token $arg2, Token $result)

Calculates and returns the quotient of the Euclidean division of one number by another.

Parameters

Token $arg1 The token containing the dividend
Token $arg2 The token containing the divisor
Token $result &$result The token containing the quotient of the division

Return Value

void

Exceptions

Exception

at line 196
static void mod(Token $arg1, Token $arg2, Token $result)

Calculates and returns the remainder of the Euclidean division of one number by another.

Parameters

Token $arg1 The token containing the dividend
Token $arg2 The token containing the divisor
Token $result &$result The token containing the remainder of the division

Return Value

void

Exceptions

Exception

at line 219
static void pow(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the first operand raised to the power of the operand.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the operation

Return Value

void

Exceptions

Exception

at line 242
static void bitwiseAnd(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the bitwise AND on the two given operands.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the bitwide AND

Return Value

void

Exceptions

Exception

at line 265
static void bitwiseXor(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the bitwise XOR on the two given operands.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the bitwide XOR

Return Value

void

Exceptions

Exception

at line 288
static void bitwiseOr(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the bitwise OR on the two given operands.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the bitwide OR

Return Value

void

Exceptions

Exception

at line 311
static void logicalAnd(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the logical AND on the two given operands.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the logical AND

Return Value

void

Exceptions

Exception

at line 353
static void logicalOr(Token $arg1, Token $arg2, Token $result)

Calculates and returns the result of the logical OR on the two given operands.

Parameters

Token $arg1 The token containing the first operand
Token $arg2 The token containing the second operand
Token $result &$result The token containing the result of the logical OR

Return Value

void

Exceptions

Exception

at line 394
static void unaryPlus(Token $arg1, Token $result)

Calculates and returns the result of the unary positive operation on the given operand.

Parameters

Token $arg1 The token containing the operand
Token $result &$result The token containing the result of the operation

Return Value

void

Exceptions

Exception

at line 416
static void unaryMinus(Token $arg1, Token $result)

Calculates and returns the result of the unary negation on the given operand.

Parameters

Token $arg1 The token containing the operand
Token $result &$result The token containing the result of the negation

Return Value

void

Exceptions

Exception

at line 438
static void not(Token $arg1, Token $result)

Calculates and returns the result of the logical negation on the given operand.

Parameters

Token $arg1 The token containing the operand
Token $result &$result The token containing the result of the logical negation

Return Value

void

Exceptions

Exception

at line 461
static void degre(Token $arg1, Token $result)

Converts a number expressed in radians to a number expressed in degrees

Parameters

Token $arg1 The token containing the number expressed in radians
Token $result &$result The token containing the number expressed in degrees

Return Value

void

Exceptions

Exception

at line 482
static void ternaryElse(Token $arg1, Token $result)

Transfers the argument into the result token (for the else part of a ternary operation)

Parameters

Token $arg1 The token containing the first operand
Token $result &$result The token containing the result of the ternary else operation

Return Value

void

at line 499
static void ternary(Token $arg1, Token $arg2, Token $arg3, Token $result)

Evaluates the first argument, if true the result is the second argument otherwise the result is the third argument

Parameters

Token $arg1 The token containing the boolean operand
Token $arg2 The token containing the second operand
Token $arg3 The token containing the third operand
Token $result &$result The token containing the result of the ternary operation

Return Value

void

Exceptions

Exception