Arithmetic Operations

Updated 1 week ago by Nandini

Like functions arithmetic operators are also type-tied. Below you will find the list of scenarios where arithmetic operators will be allowed.

Operator

LHS Data Type

RHS Data Type

Result Data Type

Plus (+)

NUMBER

NUMBER

NUMBER

Plus (+)

CURRENCY

CURRENCY of the same type.

CURRENCY

Plus (+)

DATE

NUMBER

DATEOffset by ‘NUMBER’ days.

Plus (+)

NUMBER

DATE

DATEOffset by ‘NUMBER’ days.

Plus (+)

NUMBER

DATETIME

DATETIMEOffset by ‘NUMBER’ days in the

same time zone.

Plus (+)

DATETIME

NUMBER

DATETIMEOffset by ‘NUMBER’ days in the

same time zone.

Minus (-)

NUMBER

NUMBER

NUMBER

Minus (-)

CURRENCY

CURRENCY of the same type.

CURRENCY

Minus (-)

DATE

NUMBER

DATEOffset by ‘NUMBER’ days.

Minus (-)

DATETIME

NUMBER

DATETIMEOffset by ‘NUMBER’ days in the

same time zone.

Minus (-)

DATE

DATE

NUMBERNumber of Days

Minus (-)

DATETIME

DATETIME

NUMBER Number of days

Asterik( * )

NUMBER

CURRENCY

CURRENCY of the same type

Asterik( * )

CURRENCY

NUMBER

CURRENCY of the same type

Asterik( * )

NUMBER

NUMBER

NUMBER returns product.

Slash(/)

NUMBER

NUMBER

NUMBER quotient of the division operation.

Slash(/)

CURRENCY

NUMBER

CURRENCY quotient of the same type

Slash(/)

CURRENCY

CURRENCY

NUMBER quotient of the division operation.

Cap( ^ )

NUMBER

NUMBER

NUMBER acts as the power operator and

returns the result.

Percentage ( % )

NUMBER

NUMBER

NUMBER acts as the modulo operator and

returns the remainder when LHS is divided by RHS.

Here are more articles about expressions:


How did we do?