Struct rug::rational::TryFromFloatError
source · [−]pub struct TryFromFloatError { /* private fields */ }
Expand description
An error which can be returned when a checked conversion from a floating-point
number to a Rational
number fails.
Examples
use core::convert::TryFrom;
use rug::{rational::TryFromFloatError, Rational};
// This is not finite and cannot be converted to Rational.
let inf = 1.0f32 / 0.0;
let error: TryFromFloatError = match Rational::try_from(inf) {
Ok(_) => unreachable!(),
Err(error) => error,
};
println!("Error: {}", error);
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TryFromFloatError
impl Send for TryFromFloatError
impl Sync for TryFromFloatError
impl Unpin for TryFromFloatError
impl UnwindSafe for TryFromFloatError
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Casts the value.
Casts the value.
OverflowingCasts the value.
Casts the value.
Casts the value.
Casts the value.
UnwrappedCasts the value.
Casts the value.
WrappingCasts the value.