Erlang logo
User's Guide
Reference Manual
Release Notes
PDF
Top

STDLIB
Reference Manual
Version 2.7


Expand All
Contract All

Table of Contents

math

MODULE

math

MODULE SUMMARY

Mathematical Functions

DESCRIPTION

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

Note

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

EXPORTS

pi() -> float()

A useful number.

sin(X) -> float()
cos(X) -> float()
tan(X) -> float()
asin(X) -> float()
acos(X) -> float()
atan(X) -> float()
atan2(Y, X) -> float()
sinh(X) -> float()
cosh(X) -> float()
tanh(X) -> float()
asinh(X) -> float()
acosh(X) -> float()
atanh(X) -> float()
exp(X) -> float()
log(X) -> float()
log2(X) -> float()
log10(X) -> float()
pow(X, Y) -> float()
sqrt(X) -> float()

Types:

Y = X = number()

A collection of math functions which return floats. Arguments are numbers.

erf(X) -> float()

Types:

X = number()

Returns the error function of X, where

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

erfc(X) -> float()

Types:

X = number()

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

Bugs

As these are the C library, the bugs are the same.