Skip to content

stdlib_math

Neil Tallim edited this page Jul 14, 2015 · 2 revisions

Introduction

The math namespace provides math-specific functions, for computation-oriented domains.

Provides

Subnamespaces

Functions

get_e()

Returns the value of e as defined by Python.

get_pi()

Returns the value of pi as defined by Python.

abs(v)

Returns the absolute value of v.

ceil(v)

Returns the ceiling of v as an integer.

ceiling(v)

An alias for ceil().

floor(v)

Returns the floor of v as an integer.

round(v, digits)

Returns v rounded to the specified number of significant digits, which may be 0.

The value returned is always a float.

max(items)

Returns the highest-valued item in items.

min(items)

Returns the lowest-valued item in items.

mean(items)

Returns the mean of all items.

median(items)

Returns the median of all items.

mode(items)

Returns the mode of all items.

pow(v, exponent)

Returns v raised to the power of exponent.

sqrt(v, exponent)

Returns the square root of v.

sum(items)

Returns the sum of of all items.

factorial(v)

Returns v factorial.

log(v, base)

Returns the logarithm of v in terms of base.