Skip to main content

fake_exponential

Function fake_exponential 

Source
pub fn fake_exponential(
    factor: U256,
    numerator: U256,
    denominator: u64,
) -> Result<U256, FakeExponentialError>
Expand description

Approximates factor * e ** (numerator / denominator) using Taylor expansion https://eips.ethereum.org/EIPS/eip-4844#helpers 400_000_000 numerator is the limit for this operation to work with U256, it will overflow with a larger numerator