pub trait Rational: 'static + Default + Copy + Sealed {
const F64: f64 = <Self as PrivateF64Helper>::F64;
}Expand description
Type-level rational numbers.
Provided Associated Constants§
sourceconst F64: f64 = <Self as PrivateF64Helper>::F64
const F64: f64 = <Self as PrivateF64Helper>::F64
Approximate 64-bit floating point number of this rational number.
§Examples
use typerat::*;
assert_eq!(Q::<Z0>::F64, 0_f64);
assert_eq!(Q::<P1>::F64, 1_f64);
assert_eq!(Q::<N1>::F64, -1_f64);
assert_eq!(Q::<N1, P2>::F64, -0.5_f64);
assert_eq!(Q::<P1, P3>::F64, 1_f64 / 3_f64);
assert_eq!(Q::<N5, P3>::F64, -1_f64 - 1_f64 / 1.5_f64);Object Safety§
This trait is not object safe.