alloy::core::f32

Function neg

source
pub const fn neg(x: f32) -> f32
Expand description

Computes the negation of a 32-bit floating point number at compile-time.

NOTE: Unlike the standard Neg trait for f32, this function will return the negation of a floating point number, even if it is a NaN. This means that the representation of the NaN may change by calling this, even though the value is still a NaN.

ยงParameters

  • x - The floating point number.