ACOS

All functions > MATH > ACOS

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

Syntax

ACOS(number: T) → DOUBLE
sql

Type Parameters:

  • T: Any numeric type (TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL)

Arguments

ParameterTypeRequiredDescription
numberTYesA number between -1 and 1 (inclusive)

Returns

DOUBLE - Arccosine in radians (between 0 and π)

Notes

  • Input must be in the range [-1, 1]
  • Returns values in the range [0, π] radians
  • ACOS(1) = 0, ACOS(-1) = π, ACOS(0) = π/2
  • Returns NULL if input is NULL
  • Returns NaN for inputs outside [-1, 1]
  • Inverse of COS function: ACOS(COS(x)) = x for x in [0, π]

Examples

Last update at: 2025/10/13 10:23:46