Mojo module
numerics
Defines utilities to work with numeric types.
You can import these APIs from the utils
package. For example:
from utils.numerics import FPUtils
from utils.numerics import FPUtils
Structsβ
- β
FlushDenormals
: Flushes and denormals are set to zero within the context and the state is restored to the prior value on exit. - β
FPUtils
: Collection of utility functions for working with FP values.
Functionsβ
- β
get_accum_type
: Returns the recommended type for accumulation operations. - β
inf
: Gets a +inf value for the given dtype. - β
isfinite
: Checks if the value is not infinite. - β
isinf
: Checks if the value is infinite. - β
isnan
: Checks if the value is Not a Number (NaN). - β
max_finite
: Returns the maximum finite value of type. - β
max_or_inf
: Returns the maximum (potentially infinite) value of type. - β
min_finite
: Returns the minimum (lowest) finite value of type. - β
min_or_neg_inf
: Returns the minimum (potentially negative infinite) value of type. - β
nan
: Gets a NaN value for the given dtype. - β
neg_inf
: Gets a -inf value for the given dtype. - β
nextafter
: Computes next representable value ofarg0
in the direction ofarg1
. - β
ulp
: Computes the ULP (units of last place) or (units of least precision) of the number.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?