Skip to main content

checked_pow

Function checked_pow 

Source
pub fn checked_pow(base: u64, exp: u32) -> Result<u64, ProgramError>
Expand description

Checked exponentiation via repeated squaring.

Computes base^exp with overflow checking at each step. Useful for compound interest and exponential decay.