Erlang - log


Advertisements

The method returns the logarithmic of the specified value.

Syntax

log(X)

Parameters

X - A value is specified for the logarithmic function.

Return Value

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

For example

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

start() ->
   Alog = log(3.14), 
   io:fwrite("~p~n",[Alog]).

Output

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

1.14422279992016
erlang_numbers.htm
Advertisements