Skip to main content

abs2

Overloads

NameDescription
abs2(const IntegerArray arr) -> IntegerArrayCalculates the absolute values squared of the IntegerArray arr element-wise.
abs2(const RealArray arr) -> RealArrayCalculates the absolute values squared of the RealArray arr element-wise.
abs2(const ComplexArray arr) -> ComplexArrayCalculates 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

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

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

Example


var arr = ComplexArray([[-2 .. 3]])
abs2(arr) // [4.0, 1.0, 0.0, 1.0, 4.0]