ARCOS Function

Returns the arccosine in radians.

Category:Trigonometric
Returned data type:DOUBLE

Syntax

ARCOS(expression)

Required Argument

expression

specifies any valid expression that evaluates to a numeric value.

Range–1 to 1
Data typeDOUBLE
SeeDS2 Expressions in SAS DS2 Programmer’s Guide

Details

The ARCOS function returns the arccosine (inverse cosine) of the argument. The value that is returned is specified in radians.

Example

The following program illustrates the ARCOS function:

Note: In this example, DS2 statements are sent to SAS using PROC DS2.
proc ds2;
data test (overwrite=yes); 
   dcl double a b c;
   method run();
      a=arcos(1);
      b=arcos(0);
      c=arcos(-.5);
      put 'a=' a;
      put 'b=' b;
      put 'c=' c;
   end;
enddata;
run;
quit;

SAS writes the following output to the log.

a= 0
b= 1.57079632679489
c= 2.09439510239319
Last updated: September 2, 2026