numaxiom 0.0.2

Lightweight numeric marker traits for ranges/signs plus constants and ops; std by default, no_std optional.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::HasNan;

/// Provides a NaN value as an associated constant.
pub trait NanConst: HasNan {
    const NAN: Self;
}

macro_rules! impl_nan_const_for_float {
    ($($ty:ty),+ $(,)?) => {
        $(
            impl NanConst for $ty {
                const NAN: Self = <$ty>::NAN;
            }
        )+
    };
}

impl_nan_const_for_float!(f32, f64);