pub enum PrecisionBoundaryError {
NonFiniteInput {
kind: NonFiniteKind,
},
OutOfDomain {
reason: &'static str,
},
RoundingOverflow {
scale: u32,
},
}Expand description
Error returned by the precision-boundary conversion helpers.
Rich variants — never bool, never a sentinel value. Callers must decide
per-variant whether to propagate, substitute a documented default, or
abort the containing operation.
Variants§
NonFiniteInput
An f64 → Decimal crossing received a non-finite input.
Produced by every estimator that can diverge: covariance on a zero-variance series, regression on a rank-deficient design matrix, log of a non-positive return, sqrt of a negative residual.
Fields
kind: NonFiniteKindWhich non-finite value was seen.
OutOfDomain
A conversion succeeded in representability but violated a domain constraint.
Example: a Decimal too large for f64, or an f64 whose magnitude exceeds the Decimal 96-bit mantissa range.
Fields
RoundingOverflow
Rounding to the configured scale overflowed.
Triggered when an f64 → Decimal conversion produces a value that cannot
be rounded to scale decimal places without exceeding the Decimal range.
Trait Implementations§
Source§impl Clone for PrecisionBoundaryError
impl Clone for PrecisionBoundaryError
Source§fn clone(&self) -> PrecisionBoundaryError
fn clone(&self) -> PrecisionBoundaryError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PrecisionBoundaryError
impl Debug for PrecisionBoundaryError
Source§impl Display for PrecisionBoundaryError
impl Display for PrecisionBoundaryError
Source§impl Error for PrecisionBoundaryError
impl Error for PrecisionBoundaryError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()