Expand description
Methods from the Float trait, exposed as free functions.
Functions§
- abs
- Computes the absolute value of a number.
- abs_sub
- The positive difference of two numbers.
- acos
- Computes the arccosine of a number.
- acosh
- Inverse hyperbolic cosine function.
- asin
- Computes the arcsine of a number.
- asinh
- Inverse hyperbolic sine function.
- atan
- Computes the arctangent of a number.
- atan2
- Computes the four quadrant arctangent of two numbers.
- atanh
- Inverse hyperbolic tangent function.
- cbrt
- Takes the cubic root of a number.
- ceil
- Returns the smallest integer greater than or equal to a number.
- classify
- Returns the floating point category of the number.
- cos
- Computes the cosine of a number (in radians).
- cosh
- Hyperbolic cosine function.
- epsilon
- Returns epsilon, a small positive value.
- exp
- Returns
e^x, (the exponential function). - exp2
- Returns
2^x. - exp_m1
- Returns
e^(self) - 1in a way that is accurate even if the number is close to zero. - floor
- Returns the largest integer less than or equal to a number.
- fract
- Returns the fractional part of a number.
- hypot
- Computes the length of the hypotenuse of a right-angle triangle given its legs’ lengths.
- infinity
- Returns the infinite value.
- integer_
decode - Returns the mantissa, base 2 exponent, and sign as integers, respectively.
- is_
finite - Returns
trueif this number is neither infinite norNaN. - is_
infinite - Returns
trueif this value is positive or negative infinity andfalseotherwise. - is_nan
- Returns
trueif this value isNaNand false otherwise. - is_
normal - Returns
trueif the number is neither zero, infinite, subnormal, orNaN. - is_
sign_ negative - Returns true if the input is negative.
- is_
sign_ positive - Returns true if the input is positive.
- ln
- Returns the natural logarithm of the number.
- ln_1p
- Returns
ln(1+n)(natural logarithm) more accurately than if the operations were performed separately. - log
- Returns the logarithm of the number with respect to an arbitrary base.
- log2
- Returns the base 2 logarithm of the number.
- log10
- Returns the base 10 logarithm of the number.
- max
- Returns the maximum of the two numbers.
- max_
value - Returns the largest finite value that this type can represent.
- min
- Returns the minimum of the two numbers.
- min_
positive_ value - Returns the smallest positive, normalized value that this type can represent.
- min_
value - Returns the smallest finite value that this type can represent.
- mul_add
- Fused multiply-add.
- nan
- Returns the
NaNvalue. - neg_
infinity - Returns the negative infinite value.
- neg_
zero - Returns
-0.0. - powf
- Raises a number to a floating point power.
- powi
- Raises a number to an integer power.
- recip
- Takes the reciprocal (inverse) of a number,
1/x. - round
- Returns the nearest integer to a number.
Rounds half-way cases away from
0.0. - signum
- Returns a number that represents the sign of the input.
- sin
- Computes the sine of a number (in radians).
- sin_cos
- Simultaneously computes the sine and cosine of a number
x. Returns(sin(x), cos(x)). - sinh
- Hyperbolic sine function.
- sqrt
- Takes the square root of a number.
- tan
- Computes the tangent of a number (in radians).
- tanh
- Hyperbolic tangent function.
- to_
degrees - Converts radians to degrees.
- to_
radians - Converts degrees to radians.
- trunc
- Returns the integer part of a number.