Enum spl_math::instruction::MathInstruction
source · pub enum MathInstruction {
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,
},
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
Noop
Don’t do anything for comparison
No accounts required for this instruction
Trait Implementations§
source§impl BorshDeserialize for MathInstructionwhere
u64: BorshDeserialize,
u128: BorshDeserialize,
f32: BorshDeserialize,
impl BorshDeserialize for MathInstructionwhere u64: BorshDeserialize, u128: BorshDeserialize, f32: BorshDeserialize,
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 MathInstructionwhere
u64: BorshSerialize,
u128: BorshSerialize,
f32: BorshSerialize,
impl BorshSerialize for MathInstructionwhere u64: BorshSerialize, u128: BorshSerialize, f32: BorshSerialize,
source§impl Clone for MathInstruction
impl Clone for MathInstruction
source§fn clone(&self) -> MathInstruction
fn clone(&self) -> MathInstruction
1.0.0 · source§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 MathInstructionwhere
u64: BorshDeserialize,
u128: BorshDeserialize,
f32: BorshDeserialize,
impl EnumExt for MathInstructionwhere u64: BorshDeserialize, u128: BorshDeserialize, f32: BorshDeserialize,
source§impl PartialEq for MathInstruction
impl PartialEq for MathInstruction
source§fn eq(&self, other: &MathInstruction) -> bool
fn eq(&self, other: &MathInstruction) -> bool
self and other values to be equal, and is used
by ==.