Skip to main content

is_finite

Function is_finite 

Source
pub fn is_finite(value: f32) -> bool
Expand description

Validates that a value is finite (not NaN or Infinity).

§Arguments

  • value - Value to validate

§Returns

true if the value is finite, false otherwise.

§Example

use aether_core::param::validation::is_finite;

assert!(is_finite(1.0));
assert!(is_finite(0.0));
assert!(is_finite(-100.0));
assert!(!is_finite(f32::NAN));
assert!(!is_finite(f32::INFINITY));
assert!(!is_finite(f32::NEG_INFINITY));