math (stdlib v3.15.2)

This module provides an interface to a number of mathematical functions.

Not all functions are provided on all platforms. In particular, the erf/1 and erfc/1 functions are not provided on Windows.

Limitations

As these are the C library, the same limitations apply.

Link to this section Summary

Functions

A collection of mathematical functions that return floats. Arguments are numbers.

Returns the error function of X, where

erfc(X) returns 1.0 - erf(X), computed by methods that avoid cancellation for large X.

A useful number.

Link to this section Functions

Link to this function

acos/1

(since OTP 18.0,OTP 20.0)

Specs

acos(X) -> float() when X :: number().

A collection of mathematical functions that return floats. Arguments are numbers.

Link to this function

acosh/1

(since OTP 18.0,OTP 20.0)

Specs

acosh(X) -> float() when X :: number().
Link to this function

asin/1

(since OTP 18.0,OTP 20.0)

Specs

asin(X) -> float() when X :: number().
Link to this function

asinh/1

(since OTP 18.0,OTP 20.0)

Specs

asinh(X) -> float() when X :: number().
Link to this function

atan/1

(since OTP 18.0,OTP 20.0)

Specs

atan(X) -> float() when X :: number().
Link to this function

atan2/2

(since OTP 18.0,OTP 20.0)

Specs

atan2(Y, X) -> float() when Y :: number(), X :: number().
Link to this function

atanh/1

(since OTP 18.0,OTP 20.0)

Specs

atanh(X) -> float() when X :: number().
Link to this function

ceil/1

(since OTP 18.0,OTP 20.0)

Specs

ceil(X) -> float() when X :: number().
Link to this function

cos/1

(since OTP 18.0,OTP 20.0)

Specs

cos(X) -> float() when X :: number().
Link to this function

cosh/1

(since OTP 18.0,OTP 20.0)

Specs

cosh(X) -> float() when X :: number().

Specs

erf(X) -> float() when X :: number().

Returns the error function of X, where:

erf(X) = 2/sqrt(pi)*integral from 0 to X of exp(-t*t) dt.

Specs

erfc(X) -> float() when X :: number().

erfc(X) returns 1.0 - erf(X), computed by methods that avoid cancellation for large X.

Link to this function

exp/1

(since OTP 18.0,OTP 20.0)

Specs

exp(X) -> float() when X :: number().
Link to this function

floor/1

(since OTP 18.0,OTP 20.0)

Specs

floor(X) -> float() when X :: number().
Link to this function

fmod/2

(since OTP 18.0,OTP 20.0)

Specs

fmod(X, Y) -> float() when X :: number(), Y :: number().
Link to this function

log/1

(since OTP 18.0,OTP 20.0)

Specs

log(X) -> float() when X :: number().
Link to this function

log10/1

(since OTP 18.0,OTP 20.0)

Specs

log10(X) -> float() when X :: number().
Link to this function

log2/1

(since OTP 18.0,OTP 20.0)

Specs

log2(X) -> float() when X :: number().

Specs

pi() -> float().

A useful number.

Link to this function

pow/2

(since OTP 18.0,OTP 20.0)

Specs

pow(X, Y) -> float() when X :: number(), Y :: number().
Link to this function

sin/1

(since OTP 18.0,OTP 20.0)

Specs

sin(X) -> float() when X :: number().
Link to this function

sinh/1

(since OTP 18.0,OTP 20.0)

Specs

sinh(X) -> float() when X :: number().
Link to this function

sqrt/1

(since OTP 18.0,OTP 20.0)

Specs

sqrt(X) -> float() when X :: number().
Link to this function

tan/1

(since OTP 18.0,OTP 20.0)

Specs

tan(X) -> float() when X :: number().
Link to this function

tanh/1

(since OTP 18.0,OTP 20.0)

Specs

tanh(X) -> float() when X :: number().