ACOS()

All functions > MATH > ACOS()

Returns the arccosine (inverse cosine) of a number, in radians.

Signatures

Arccosine

Returns: Angle in radians, in [0, π]

ACOS(number: T) → DOUBLE
sql
ParameterTypeRequiredDescription
numberTYesA number in [-1, 1]

With:

  • T : Floating-point type (FLOAT, DOUBLE)

Signature notes:

  • Input must be in [-1, 1]
  • ACOS(1.0) = 0, ACOS(-1.0) = π, ACOS(0.0) = π/2
  • Returns NaN for inputs outside [-1, 1]
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := ACOS(1.0E0), -- acos(1) = 0
    f2 := ACOS(0.5E0), -- acos(0.5) = π/3
    f3 := ACOS(0.0E0), -- acos(0) = π/2
    f4 := ACOS(-1.0E0) -- acos(-1) = π
;
Result
f1 VARCHARf2 VARCHARf3 VARCHARf4 VARCHAR
0.01.04719755119659761.57079632679489663.141592653589793

Last update at: 2026/05/26 17:22:09