abs
Overloads
| Name | Description |
|---|---|
abs(const ComplexArray arr) -> ComplexArray | Calculates the absolute values of the ComplexArray arr element-wise. |
abs(const IntegerArray arr) -> IntegerArray | Calculates the absolute values of the IntegerArray arr element-wise. |
abs(const RealArray arr) -> RealArray | Calculates the absolute values of the RealArray arr element-wise. |
abs(const ComplexArray arr) -> ComplexArray
Calculates the absolute values of the ComplexArray arr element-wise.
Parameters
- arr: The input ComplexArray.
Example
var arr = ComplexArray([[-2 .. 3]])
abs(arr) // [2.0, 1.0, 0.0, 1.0, 2.0]
abs(const IntegerArray arr) -> IntegerArray
Calculates the absolute values of the IntegerArray arr element-wise.
Parameters
- arr: The input IntegerArray.
Example
var arr = IntegerArray([[-2 .. 3]])
abs(arr) // [2.0, 1.0, 0.0, 1.0, 2.0]
abs(const RealArray arr) -> RealArray
Calculates the absolute values of the RealArray arr element-wise.
Parameters
- arr: The input RealArray.
Example
var arr = RealArray([[-2 .. 3]])
abs(arr) // [2.0, 1.0, 0.0, 1.0, 2.0]