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