Erlang - sin


Advertisements

This method returns the sine of the specified value.

Syntax

sin(X)

Parameters

X - A value is specified for the sine function.

Return Value

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

For example

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

start() -> 
   Sin = sin(45), 
   io:fwrite("~p~n",[Sin]).

Output

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

0.8509035245341184
erlang_numbers.htm
Advertisements