SourceForge.net Logo

Euphoria Standard Library
(ESL)

Home Page | Project Status | Contribute | Guidelines and Information



Euphoria Standard Library module:

math.e



1. Introduction


This module contains all the common math routines that many other languages have. All routines should operate on sequences of numbers as well as on single numbers (atoms) when possible, see Operations on Sequences from the Euphoria reference manual.

Should probably use stuff from genfunc.e in the archives.



2. Constants

E

Description: E = 2.718281828459045235
Status: PROPOSED


3. Routines

abs

Syntax: a = abs(x)
Description: Returns the absolute value of the number.
Status: PROPOSED


add_all, sum, sum_elements, sum_sequence

Syntax: a = add_all(s), ...
Description: Adds all elements of s.
Status: PROPOSED


arccosh

Syntax: a = arccosh(x)
Description: Returns the hyperbolic arccosine of x.
Status: PROPOSED


arcsinh

Syntax: a = arcsinh(x)
Description: Returns the hyperbolic arcsine of x.
Status: PROPOSED


arctanh

Syntax: a = arctanh(x)
Description: Returns the hyperbolic arctangent of x.
Status: PROPOSED


ceil

Syntax: a = ceil(x)
Description: Rounds number towards positive infinity (opposite of Euphoria's floor()).
Status: PROPOSED


cosh

Syntax: a = cosh(x)
Description: Returns the hyperbolic cosine of x.
Status: PROPOSED


fraction, frac, fractional

Syntax: a = fraction(x), ...
Description: Returns the fraction part of the number (e.g. fraction(3.14) returns 0.14).
Status: PROPOSED


log10

Syntax: a = log10(x)
Description: Calculates log base 10 of x.
Status: PROPOSED


log2

Syntax: a = log2(x)
Description: Calculates log base 2 of x. Used fairly commonly in computer science.
Status: PROPOSED


max

Syntax: a = max(s)
Description: Returns the element with the largest value in s.
Status: PROPOSED


min

Syntax: a = min(s)
Description: Returns the element with the smallest value in s.
Status: PROPOSED


multiply_all, product, product_elements, product_sequence

Syntax: a = multiply_all(s), ...
Description: Multiplies all elements of s.
Status: PROPOSED


round

Syntax: a = round(x)
Description: Rounds number towards nearest whole number.
Status: PROPOSED


sign

Syntax: a = sign(x)
Description: Returns 1 for positive numbers, -1 for negative numbers, and 0 for 0.
Status: PROPOSED


sinh

Syntax: a = sinh(x)
Description: Returns the hyperbolic sine of x.
Status: PROPOSED


tanh

Syntax: a = tanh(x)
Description: Returns the hyperbolic tangent of x.
Status: PROPOSED


truncate, trunc

Syntax: a = truncate(x), ...
Description: Returns the non-fraction part of the number (e.g. truncate(3.14) returns 3).
Status: PROPOSED