std::math
This module provides a Pyro interface to the C standard library's mathematical functions.
Functions
-
abs(x: i64|f64) -> i64|f64
abs(x: i64|f64, i64_min: any) -> any -
Returns the absolute value of
x. The output type is the same as the input type.Note that the absolute value of
I64_MIN(i.e. the most negative integer) is undefined as the result cannot be represented as ani64. If you provide an optionali64_minargument, its value will be returned as a fallback in this case. Otherwise, the return value will be whatever integer is returned by the underlying C implementation — typically a negative value. -
acos(x: i64|f64) -> f64 -
Returns the arc cosine of
xin radians. -
asin(x: i64|f64) -> f64 -
Returns the arc sine of
xin radians. -
atan(x: i64|f64) -> f64 -
Returns the arc tangent of
xin radians. -
atan2(y: i64|f64, x: i64|f64) -> f64 -
Returns the arc tangent of
y/xin radians as anf64using 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
xas a float. -
cos(x: i64|f64) -> f64 -
Returns the cosine of
x, wherexis in radians. -
exp(x: i64|f64) -> f64 -
Returns
eto the power ofx. -
floor(x: i64|f64) -> f64 -
Returns the highest integer value less than or equal to
xas 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
blogarithm ofx. -
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, wherexis in radians. -
sqrt(x: i64|f64) -> f64 -
Returns the square root of
x. -
tan(x: i64|f64) -> f64 -
Returns the tangent of
x, wherexis in radians.