pub trait FixedPoint: Sized {
    fn fixed_mul_floor(self, y: Self, denominator: Self) -> Option<Self>;
    fn fixed_mul_ceil(self, y: Self, denominator: Self) -> Option<Self>;
    fn fixed_div_floor(self, y: Self, denominator: Self) -> Option<Self>;
    fn fixed_div_ceil(self, y: Self, denominator: Self) -> Option<Self>;
}

Required Methods§

Safely calculates floor(x * y / denominator). Returns None if a phantom overflow occurs or if the denominator is 0.

Safely calculates ceil(x * y / denominator). Returns None if a phantom overflow occurs or if the denominator is 0.

Safely calculates floor(x * denominator / y). Returns None if a phantom overflow occurs or if the denominator is 0.

Safely calculates ceil(x * denominator / y). Returns None if a phantom overflow occurs or if the denominator is 0.

Implementations on Foreign Types§

Implementors§