Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section


A scalar numeric function that returns the arc-cosine, in radians, of a given cosine.


{fn ACOS(float-expression)}


Argument Description
float-expression An expression of type float or real, whose value is between -1 and 1. This is the cosine of the angle.


ACOS takes a numeric value and returns the inverse (arc) of its cosine as a floating point number. The value of float-expression must be a signed decimal number ranging from 1 to -1 (inclusive). A number outside of this range causes a runtime error, generating an SQLCODE -400 (fatal error occurred). ACOS returns NULL if passed a NULL value. ACOS treats nonnumeric strings, including the empty string (''), as the numeric value 0.

ACOS returns a value of data type FLOAT with a precision of 19 and a scale of 18.

ACOS can only be used as an ODBC scalar function (with the curly brace syntax).

You can use the DEGREES function to convert radians to degrees. You can use the RADIANS function to convert degrees to radians.


The following examples show the effect of ACOS on two cosines:

SELECT {fn ACOS(0.52)} AS ArcCosine 
Copy code to clipboard

returns 1.023945...

SELECT {fn ACOS(-1)} AS ArcCosine
Copy code to clipboard

returns pi (3.14159...).

See Also

FeedbackOpens in a new window