Trait wasmi_core::Float

source ·
pub trait Float<T>: ArithmeticOps<T> {
    // Required methods
    fn abs(self) -> T;
    fn floor(self) -> T;
    fn ceil(self) -> T;
    fn trunc(self) -> T;
    fn round(self) -> T;
    fn nearest(self) -> T;
    fn sqrt(self) -> T;
    fn is_sign_positive(self) -> bool;
    fn is_sign_negative(self) -> bool;
    fn min(self, other: T) -> T;
    fn max(self, other: T) -> T;
    fn copysign(self, other: T) -> T;
}
Expand description

Float-point value.

Required Methods§

source

fn abs(self) -> T

Get absolute value.

source

fn floor(self) -> T

Returns the largest integer less than or equal to a number.

source

fn ceil(self) -> T

Returns the smallest integer greater than or equal to a number.

source

fn trunc(self) -> T

Returns the integer part of a number.

source

fn round(self) -> T

Returns the nearest integer to a number. Round half-way cases away from 0.0.

source

fn nearest(self) -> T

Returns the nearest integer to a number. Ties are round to even number.

source

fn sqrt(self) -> T

Takes the square root of a number.

source

fn is_sign_positive(self) -> bool

Returns true if the sign of the number is positive.

source

fn is_sign_negative(self) -> bool

Returns true if the sign of the number is negative.

source

fn min(self, other: T) -> T

Returns the minimum of the two numbers.

source

fn max(self, other: T) -> T

Returns the maximum of the two numbers.

source

fn copysign(self, other: T) -> T

Sets sign of this value to the sign of other value.

Implementations on Foreign Types§

source§

impl Float<f64> for f64

source§

fn abs(self) -> f64

source§

fn floor(self) -> f64

source§

fn ceil(self) -> f64

source§

fn trunc(self) -> f64

source§

fn round(self) -> f64

source§

fn nearest(self) -> f64

source§

fn sqrt(self) -> f64

source§

fn is_sign_positive(self) -> bool

source§

fn is_sign_negative(self) -> bool

source§

fn min(self, other: f64) -> f64

source§

fn max(self, other: f64) -> f64

source§

fn copysign(self, other: f64) -> f64

source§

impl Float<f32> for f32

source§

fn abs(self) -> f32

source§

fn floor(self) -> f32

source§

fn ceil(self) -> f32

source§

fn trunc(self) -> f32

source§

fn round(self) -> f32

source§

fn nearest(self) -> f32

source§

fn sqrt(self) -> f32

source§

fn is_sign_positive(self) -> bool

source§

fn is_sign_negative(self) -> bool

source§

fn min(self, other: f32) -> f32

source§

fn max(self, other: f32) -> f32

source§

fn copysign(self, other: f32) -> f32

Implementors§