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>;
}
๐Deprecated since 0.1.0: please use crate
soroban-fixed-point-math
insteadRequired 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>
soroban-fixed-point-math
insteadSafely 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>
soroban-fixed-point-math
insteadSafely 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>
soroban-fixed-point-math
insteadSafely 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>
soroban-fixed-point-math
insteadSafely 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", so this trait is not object safe.
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>
๐Deprecated since 0.1.0: please use crate
soroban-fixed-point-math
insteadSourceยงfn fixed_mul_ceil(self, y: i128, denominator: i128) -> Option<i128>
fn fixed_mul_ceil(self, y: i128, denominator: i128) -> Option<i128>
๐Deprecated since 0.1.0: please use crate
soroban-fixed-point-math
insteadSourceยง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>
๐Deprecated since 0.1.0: please use crate
soroban-fixed-point-math
insteadSourceยงfn fixed_mul_ceil(self, y: u64, denominator: u64) -> Option<u64>
fn fixed_mul_ceil(self, y: u64, denominator: u64) -> Option<u64>
๐Deprecated since 0.1.0: please use crate
soroban-fixed-point-math
instead