Trait FixedPoint

Source
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 instead

Required Methodsยง

Source

fn fixed_mul_floor(self, y: Self, denominator: Self) -> Option<Self>

๐Ÿ‘ŽDeprecated since 0.1.0: 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.

Source

fn fixed_mul_ceil(self, y: Self, denominator: Self) -> Option<Self>

๐Ÿ‘ŽDeprecated since 0.1.0: 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.

Source

fn fixed_div_floor(self, y: Self, denominator: Self) -> Option<Self>

๐Ÿ‘ŽDeprecated since 0.1.0: 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.

Source

fn fixed_div_ceil(self, y: Self, denominator: Self) -> Option<Self>

๐Ÿ‘ŽDeprecated since 0.1.0: 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", so this trait is not object safe.

Implementations on Foreign Typesยง

Sourceยง

impl FixedPoint for i128

Sourceยง

fn fixed_mul_floor(self, y: i128, denominator: i128) -> Option<i128>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

fn fixed_mul_ceil(self, y: i128, denominator: i128) -> Option<i128>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

fn fixed_div_floor(self, y: i128, denominator: i128) -> Option<i128>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

fn fixed_div_ceil(self, y: i128, denominator: i128) -> Option<i128>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

impl FixedPoint for u64

Sourceยง

fn fixed_mul_floor(self, y: u64, denominator: u64) -> Option<u64>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

fn fixed_mul_ceil(self, y: u64, denominator: u64) -> Option<u64>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

fn fixed_div_floor(self, y: u64, denominator: u64) -> Option<u64>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead
Sourceยง

fn fixed_div_ceil(self, y: u64, denominator: u64) -> Option<u64>

๐Ÿ‘ŽDeprecated since 0.1.0: please use crate soroban-fixed-point-math instead

Implementorsยง