numojo.routines.math.rounding¶
Rounding routines for NuMojo (numojo.routines.math.rounding).
Offers rounding, truncation, absolute value, and next-after helpers for NDArrays.
Functions¶
tabs¶
Element-wise absolute value of NDArray.
Parameters:
dtype(DType): The element type.backend(Backend): Sets utility function origin, defaults toVectorized.
Args:
array(NDArray): A NDArray.
Returns:
NDArray
Raises
tfloor¶
Element-wise round down to nearest whole number of NDArray.
Parameters:
dtype(DType): The element type.backend(Backend): Sets utility function origin, defaults toVectorized.
Args:
array(NDArray): A NDArray.
Returns:
NDArray
Raises
tceil¶
Element-wise round up to nearest whole number of NDArray.
Parameters:
dtype(DType): The element type.backend(Backend): Sets utility function origin, defaults toVectorized.
Args:
array(NDArray): A NDArray.
Returns:
NDArray
Raises
ttrunc¶
Element-wise remove decimal value from float whole number of NDArray.
Parameters:
dtype(DType): The element type.backend(Backend): Sets utility function origin, defaults toVectorized.
Args:
array(NDArray): A NDArray.
Returns:
NDArray
Raises
tround¶
Element-wise round NDArray to whole number.
Parameters:
dtype(DType): The element type.backend(Backend): Sets utility function origin, defaults toVectorized.
Args:
array(NDArray): A NDArray.
Returns:
NDArray
Raises
roundeven¶
Performs element-wise banker's rounding on the elements of a NDArray.
The element-wise banker's rounding of NDArray.
This rounding goes to the nearest integer with ties toward the nearest even integer.
Parameters:
dtype(DType): The dtype of the input and output array.backend(Backend): Sets utility function origin, defaults toVectorized.
Args:
array(NDArray): Array to perform rounding on.
Returns:
NDArray
Raises
nextafter¶
nextafter[dtype: DType, backend: Backend = Vectorized](array1: NDArray[dtype], array2: NDArray[dtype]) -> NDArray[dtype]
Computes the nextafter of the inputs.
Parameters:
dtype(DType): The dtype of the input and output array. Constraints: must be a floating-point type.backend(Backend): Sets utility function origin, default toVectorized.
Args:
array1(NDArray): The first input argument.array2(NDArray): The second input argument.
Returns:
NDArray
Raises