OxL Reference

method f32.abs

The absolute value.

Example:

oxl✓ checked in CI
fn main() io {
  let x: f32 = -2.5
  print("{x.abs()}")
}
Output
2.5
pub(api) fn abs() -> f32

Complexity. O(1).

Since. 1.0.0-beta

Returns

f32

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/numbers.oxl:4213

See also