Trait wiwi::num::FromF64Lossless

source ·
pub trait FromF64Lossless: Base {
    // Required method
    fn from_f64(val: f64) -> Self;
}
Expand description

Lossless conversion from f64

That is, this trait is implemented for a number type, when you can convert a f64 to the number type while guaranteeing absolutely no losses for all possible values. This is not the same as an as cast!

Required Methods§

source

fn from_f64(val: f64) -> Self

Losslessly converts the provided f64 into Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromF64Lossless for f64

source§

fn from_f64(val: f64) -> f64

Losslessly converts the provided f64 into f64

Implementors§