Erlang - acos



The method returns the arcsine of the specified value.

Syntax

acos(X)

Parameters

X - A value is specified for the arccosine function.

Return Value

The return value is a float value representing the arccosine value.

For example

-module(helloworld). 
-import(math,[acos/1]). 
-export([start/0]). 

start() ->
   Acos = acos(0.7071), 
   io:fwrite("~p~n",[Acos]).

Output

When we run the above program, we will get the following result.

0.785407753397449
erlang_numbers.htm
Advertisements