Pyro

A dynamically-typed, garbage-collected scripting language.

Version 0.17.0

std::math


This module provides a Pyro interface to the C standard library's mathematical functions.

Functions

abs(x: i64|f64) -> i64|f64

Returns the absolute value of x. The output type is the same as the input type.

Panics if the argument is an i64 with value i64_min (i.e. the most negative i64 integer) as the result cannot be represented as an i64 value.

acos(x: i64|f64) -> f64

Returns the arc cosine of x in radians.

asin(x: i64|f64) -> f64

Returns the arc sine of x in radians.

atan(x: i64|f64) -> f64

Returns the arc tangent of x in radians.

atan2(y: i64|f64, x: i64|f64) -> f64

Returns the arc tangent of y/x in radians as an f64 using the signs of the arguments to determine the correct quadrant.

cbrt(x: i64|f64) -> f64

Returns the cubic root of x.

ceil(x: i64|f64) -> f64

Returns the lowest integer value greater than or equal to x as a float.

cos(x: i64|f64) -> f64

Returns the cosine of x, where x is in radians.

exp(x: i64|f64) -> f64

Returns e to the power of x.

floor(x: i64|f64) -> f64

Returns the highest integer value less than or equal to x as a float.

ln(x: i64|f64) -> f64

Returns the natural logarithm (i.e. the base-e logarithm) of x.

log(b: i64|f64, x: i64|f64) -> f64

Returns the base b logarithm of x.

log2(x: i64|f64) -> f64

Returns the base-2 logarithm of x.

log10(x: i64|f64) -> f64

Returns the base-10 logarithm of x.

sin(x: i64|f64) -> f64

Returns the sine of x, where x is in radians.

sqrt(x: i64|f64) -> f64

Returns the square root of x.

tan(x: i64|f64) -> f64

Returns the tangent of x, where x is in radians.