ACOS

Overview

Calculate the arc cosine of the input value, returning a value in radians in the range [0, π].

Syntax

ACOS(<expr>)

Parameters

  • <expr>: DOUBLE type, value range [-1, 1]; other numeric types are implicitly converted to DOUBLE. Returns NaN if out of range. Returns NULL if <expr> is NULL.

Usage Examples

SELECT acos(-1); -- 3.141592653589793 SELECT acos(0); -- 1.5707963267948966 SELECT acos(1); -- 0 SELECT acos(2); -- NaN

  • ASIN — Arc sine
  • ATAN — Arc tangent
  • COS — Cosine