pub enum MathInstruction {
Show 16 variants
PreciseSquareRoot {
radicand: u64,
},
SquareRootU64 {
radicand: u64,
},
SquareRootU128 {
radicand: u128,
},
U64Multiply {
multiplicand: u64,
multiplier: u64,
},
U64Divide {
dividend: u64,
divisor: u64,
},
F32Multiply {
multiplicand: f32,
multiplier: f32,
},
F32Divide {
dividend: f32,
divisor: f32,
},
F32Exponentiate {
base: f32,
exponent: f32,
},
F32NaturalLog {
argument: f32,
},
F32NormalCDF {
argument: f32,
},
F64Pow {
base: f64,
exponent: f64,
},
U128Multiply {
multiplicand: u128,
multiplier: u128,
},
U128Divide {
dividend: u128,
divisor: u128,
},
F64Multiply {
multiplicand: f64,
multiplier: f64,
},
F64Divide {
dividend: f64,
divisor: f64,
},
Noop,
}Expand description
Instructions supported by the math program, used for testing instruction counts
Variants§
PreciseSquareRoot
Calculate the square root of the given u64 with decimals
No accounts required for this instruction
SquareRootU64
Calculate the integer square root of the given u64
No accounts required for this instruction
SquareRootU128
Calculate the integer square root of the given u128
No accounts required for this instruction
U64Multiply
Multiply two u64 values
No accounts required for this instruction
U64Divide
Divide two u64 values
No accounts required for this instruction
F32Multiply
Multiply two float values
No accounts required for this instruction
F32Divide
Divide two float values
No accounts required for this instruction
F32Exponentiate
Exponentiate a float base by a power
No accounts required for this instruction
F32NaturalLog
Natural Log of a float
No accounts required for this instruction
F32NormalCDF
The Normal CDF of a float
No accounts required for this instruction
F64Pow
Pow two float values
No accounts required for this instruction
U128Multiply
Multiply two u128 values
No accounts required for this instruction
U128Divide
Divide two u128 values
No accounts required for this instruction
F64Multiply
Multiply two f64 values
No accounts required for this instruction
F64Divide
Divide two f64 values
No accounts required for this instruction
Noop
Don’t do anything for comparison
No accounts required for this instruction
Trait Implementations§
Source§impl BorshDeserialize for MathInstruction
impl BorshDeserialize for MathInstruction
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for MathInstruction
impl BorshSerialize for MathInstruction
Source§impl Clone for MathInstruction
impl Clone for MathInstruction
Source§fn clone(&self) -> MathInstruction
fn clone(&self) -> MathInstruction
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MathInstruction
impl Debug for MathInstruction
Source§impl EnumExt for MathInstruction
impl EnumExt for MathInstruction
Source§impl PartialEq for MathInstruction
impl PartialEq for MathInstruction
impl StructuralPartialEq for MathInstruction
Auto Trait Implementations§
impl Freeze for MathInstruction
impl RefUnwindSafe for MathInstruction
impl Send for MathInstruction
impl Sync for MathInstruction
impl Unpin for MathInstruction
impl UnwindSafe for MathInstruction
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)