pub trait SafeMath {
    type Output;

    fn safe_add(
        &self,
        rhs: Self::Output
    ) -> StdResult<Self::Output, ProgramError>; fn safe_sub(
        &self,
        rhs: Self::Output
    ) -> StdResult<Self::Output, ProgramError>; fn safe_div(
        &self,
        rhs: Self::Output
    ) -> StdResult<Self::Output, ProgramError>; fn safe_mul(
        &self,
        rhs: Self::Output
    ) -> StdResult<Self::Output, ProgramError>; fn safe_pow(&self, exp: u32) -> StdResult<Self::Output, ProgramError>; }
Expand description

Defines a set of safe math operations that return a ProgramError which is expected in an anchor instruction execution.

Required Associated Types

Required Methods

Implementations on Foreign Types

$type implementation of the SafeMath trait

$type implementation of the SafeMath trait

$type implementation of the SafeMath trait

$type implementation of the SafeMath trait

$type implementation of the SafeMath trait

Implementors