1//! Extended helper trait for generic float types.
2//!
3//! This adds cache types and other helpers for extended-precision work.
45#![doc(hidden)]
67#[cfg(feature = "f16")]
8use lexical_util::bf16::bf16;
9use lexical_util::extended_float::ExtendedFloat;
10#[cfg(feature = "f16")]
11use lexical_util::f16::f16;
1213#[cfg(not(feature = "compact"))]
14use crate::algorithm::DragonboxFloat;
15#[cfg(feature = "compact")]
16use crate::compact::GrisuFloat;
1718/// Alias with ~80 bits of precision, 64 for the mantissa and 16 for exponent.
19/// This exponent is biased, and if the exponent is negative, it represents
20/// a value with a bias of `i32::MIN + F::EXPONENT_BIAS`.
21pub type ExtendedFloat80 = ExtendedFloat<u64>;
2223/// Helper trait to add more float characteristics for parsing floats.
24#[cfg(feature = "compact")]
25pub trait RawFloat: GrisuFloat {}
2627#[cfg(not(feature = "compact"))]
28pub trait RawFloat: DragonboxFloat {}
2930impl RawFloat for f32 {
31}
32impl RawFloat for f64 {
33}
34#[cfg(feature = "f16")]
35impl RawFloat for f16 {
36}
37#[cfg(feature = "f16")]
38impl RawFloat for bf16 {
39}