pub trait FixedPoint: Sized {
// Required methods
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>;
}please use crate soroban-fixed-point-math instead
Required Methodsยง
Sourcefn fixed_mul_floor(self, y: Self, denominator: Self) -> Option<Self>
๐Deprecated since 0.1.0: please use crate soroban-fixed-point-math instead
fn fixed_mul_floor(self, y: Self, denominator: Self) -> Option<Self>
please use crate soroban-fixed-point-math instead
Safely calculates floor(x * y / denominator). Returns None if a phantom overflow occurs or if the denominator is 0.
Sourcefn fixed_mul_ceil(self, y: Self, denominator: Self) -> Option<Self>
๐Deprecated since 0.1.0: please use crate soroban-fixed-point-math instead
fn fixed_mul_ceil(self, y: Self, denominator: Self) -> Option<Self>
please use crate soroban-fixed-point-math instead
Safely calculates ceil(x * y / denominator). Returns None if a phantom overflow occurs or if the denominator is 0.
Sourcefn fixed_div_floor(self, y: Self, denominator: Self) -> Option<Self>
๐Deprecated since 0.1.0: please use crate soroban-fixed-point-math instead
fn fixed_div_floor(self, y: Self, denominator: Self) -> Option<Self>
please use crate soroban-fixed-point-math instead
Safely calculates floor(x * denominator / y). Returns None if a phantom overflow occurs or if the denominator is 0.
Sourcefn fixed_div_ceil(self, y: Self, denominator: Self) -> Option<Self>
๐Deprecated since 0.1.0: please use crate soroban-fixed-point-math instead
fn fixed_div_ceil(self, y: Self, denominator: Self) -> Option<Self>
please use crate soroban-fixed-point-math instead
Safely calculates ceil(x * denominator / y). Returns None if a phantom overflow occurs or if the denominator is 0.
Dyn Compatibilityยง
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Typesยง
Sourceยงimpl FixedPoint for i128
impl FixedPoint for i128
Sourceยงfn fixed_mul_floor(self, y: i128, denominator: i128) -> Option<i128>
fn fixed_mul_floor(self, y: i128, denominator: i128) -> Option<i128>
please use crate soroban-fixed-point-math instead
Sourceยงfn fixed_mul_ceil(self, y: i128, denominator: i128) -> Option<i128>
fn fixed_mul_ceil(self, y: i128, denominator: i128) -> Option<i128>
please use crate soroban-fixed-point-math instead
Sourceยงimpl FixedPoint for u64
impl FixedPoint for u64
Sourceยงfn fixed_mul_floor(self, y: u64, denominator: u64) -> Option<u64>
fn fixed_mul_floor(self, y: u64, denominator: u64) -> Option<u64>
please use crate soroban-fixed-point-math instead
Sourceยงfn fixed_mul_ceil(self, y: u64, denominator: u64) -> Option<u64>
fn fixed_mul_ceil(self, y: u64, denominator: u64) -> Option<u64>
please use crate soroban-fixed-point-math instead