ACOS (TSQL Function)

Returns the arccosine, or inverse cosine, of a number.

Syntax

ACOS ( float_expression )

Arguments

float_expression
is an expression of type float, in the range [-1, 1]. Values outside this range raise an error.

Return Types

Returns float.

Examples

PRINT ACOS(-1), ACOS(0), ACOS(0.5), ACOS(1);

The result is:

       3.14159265358979|        1.5707963267949|        1.0471975511966|                      0|

With value out of range, an error is raised:

PRINT ACOS(1.1)

The result is:

<Arithmetic error. FLOAT is NaN.>
RSQL, a simple alternative to Microsoft SQL Server