Trait Constants

Source
pub trait Constants {
    // Required methods
    unsafe fn π() -> Self;
    unsafe fn ε() -> Self;
    unsafe fn e() -> Self;
}
Expand description

Float constants.

Required Methods§

Source

unsafe fn π() -> Self

returns π

§Safety

Refer to Self’s safety documentation. This function is unsafe only when used with a FFloat; Calling it with a f64 or a f32 is safe.

Source

unsafe fn ε() -> Self

returns ε

§Safety

Refer to Self’s safety documentation. This function is unsafe only when used with a FFloat; Calling it with a f64 or a f32 is safe.

Source

unsafe fn e() -> Self

returns E (euler’s number)

§Safety

Refer to Self’s safety documentation. This function is unsafe only when used with a FFloat; Calling it with a f64 or a f32 is safe.

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 Constants for f32

Source§

unsafe fn π() -> f32

Source§

unsafe fn e() -> f32

Source§

unsafe fn ε() -> f32

Source§

impl Constants for f64

Source§

unsafe fn π() -> f64

Source§

unsafe fn e() -> f64

Source§

unsafe fn ε() -> f64

Implementors§

Source§

impl<F: FastFloat + Constants> Constants for FFloat<F>