FirebirdSQL logo

MOD()

Remainder

Result type

SMALLINT, INTEGER or BIGINT depending on the type of a.If a is a floating-point type, the result is a BIGINT.

Syntax
MOD (a, b)
Table 1. MOD Function Parameters
Parameter Description

a

An expression of a numeric type

b

An expression of a numeric type

Returns the remainder of an integer division.

  • Non-integer arguments are rounded before the division takes place.So, “mod(7.5, 2.5)” gives 2 (“mod(8, 3)”), not 0.

  • Do not confuse MOD() with the mathematical modulus operator;e.g. mathematically, -21 mod 4 is 3, while Firebird’s MOD(-21, 4) is -1.In other words, MOD() behaves as % in languages like C and Java.

PI()

Approximation of pi.

Result type

DOUBLE PRECISION

Syntax
PI ()

ACOS()

Arc cosine

Result type

DOUBLE PRECISION

Syntax
ACOS (number)
Table 1. ACOS Function Parameter
Parameter Description

number

An expression of a numeric type within the range [-1, 1]

  • The result is an angle in the range [0, pi].

POWER()

Power

Result type

DOUBLE PRECISION

Syntax
POWER (x, y)
Table 1. POWER Function Parameters
Parameter Description

x

An expression of a numeric type

y

An expression of a numeric type

Returns x to the power of y (xy).