macro_rules! real32 {
($value:expr) => { ... };
}Expand description
Creates a validated single-precision real number from an f32 literal.
This macro is the f32 counterpart of real!: it provides a concise syntax
for creating RealNative32StrictFinite values
from single-precision floating-point literals. It uses the panicking
from_f32 constructor, appropriate for compile-time
constants and test code where validity is guaranteed.
§Panics
Panics if the provided value is not finite (NaN, infinity) or is subnormal.
For fallible conversion, use RealScalar::try_from_f32 directly.
§Examples
use num_valid::*;
use std::f32::consts::PI;
let x = real32!(3.14159);
let y = real32!(PI);
let z = real32!(-42.0);
assert!((x.as_raw_scalar_ref() - 3.14159).abs() < 1e-5);