English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang cos Method

Numbers in Erlang

This method returns the cosine value of the specified value.

Syntax

cos(X)

Parameter

X-Specify a value for the cosine function.

Return Value

The return value is a floating-point value representing the cosine value.

-module(helloworld). 
-import(math,[cos/1]). 
-export([start/0]). 
start() -> 
   Cosin = cos(45), 
   io:fwrite("~p~n",[Cosin]).
When we run the above program, we will get the following results.
0.5253219888177297

Numbers in Erlang