SplitScript reference / Numeric / squared

Numeric.squared

Method

T.squared() -> T where T: Numeric

Multiplies this value by itself.

Integer multiplication wraps to the receiver's declared width. Floating-point multiplication rounds at the receiver's f32 or f64 width and follows IEEE 754 for zero, infinity, and NaN.

Effects: pure

Runtime behavior: available everywhere; synchronous

Examples

Square a coordinate delta

let squaredDistance = 3.5.squared()