Struct rug::float::ValidFloat [] [src]

pub struct ValidFloat<'a> { /* fields omitted */ }

A validated string that can always be converted to a Float.

See the Float::valid_str_radix method.

Examples

use rug::Float;
use rug::float::ValidFloat;
// This string is correct in radix 10, it cannot fail.
let s = "1.25e-1";
let valid: ValidFloat = match Float::valid_str_radix(s, 10) {
    Ok(valid) => valid,
    Err(_) => unreachable!(),
};
let f = Float::with_val(53, valid);
assert_eq!(f, 0.125);

Trait Implementations

impl<'a> Clone for ValidFloat<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for ValidFloat<'a>
[src]

[src]

Formats the value using the given formatter.