fixed_point_math/
fixed_point.rs

1#[deprecated(since="0.1.0", note="please use crate `soroban-fixed-point-math` instead")]
2pub trait FixedPoint: Sized {
3    /// Safely calculates floor(x * y / denominator). Returns None if a phantom overflow
4    /// occurs or if the denominator is 0.
5    fn fixed_mul_floor(self, y: Self, denominator: Self) -> Option<Self>;
6
7    /// Safely calculates ceil(x * y / denominator). Returns None if a phantom overflow
8    /// occurs or if the denominator is 0.
9    fn fixed_mul_ceil(self, y: Self, denominator: Self) -> Option<Self>;
10
11    /// Safely calculates floor(x * denominator / y). Returns None if a phantom overflow
12    /// occurs or if the denominator is 0.
13    fn fixed_div_floor(self, y: Self, denominator: Self) -> Option<Self>;
14
15    /// Safely calculates ceil(x * denominator / y). Returns None if a phantom overflow
16    /// occurs or if the denominator is 0.
17    fn fixed_div_ceil(self, y: Self, denominator: Self) -> Option<Self>;
18}