Skip to main content

FromF64

Trait FromF64 

Source
pub trait FromF64: Copy {
    // Required methods
    fn from_f64(val: f64) -> Self;
    fn is_integral() -> bool;
}
Expand description

Trait for converting from f64 with appropriate rounding behavior Matches C++ Point constructor semantics: rounds for integral types, casts for float

Required Methods§

Source

fn from_f64(val: f64) -> Self

Source

fn is_integral() -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromF64 for f64

Source§

impl FromF64 for i64

Implementors§