Compute the absolute value of every element in nested numeric inputs.
Numeric.math.abs(value)Applies the absolute value across nested numeric inputs.
- Parameters:
value: Scalar, vector, or matrix input values
- Returns: Absolute values matching the input nesting shape
- NumPy: Covers
np.abs,np.absolute,np.fabsthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const value = Numeric.math.abs(-5)
console.log(value)
// 5import Numeric from '@neabyte/numerix'
const values = Numeric.math.abs([-1, 2, -3])
console.log(values)
// [1,2,3]import Numeric from '@neabyte/numerix'
const values = Numeric.math.abs([[-1, 2], [-3, 4]])
console.log(values)
// [[1,2],[3,4]]import Numeric from '@neabyte/numerix'
const value = Numeric.math.abs(5)
console.log(value)
// 5