Skip to main content

checked_div_ceil

Function checked_div_ceil 

Source
pub fn checked_div_ceil(a: u64, b: u64) -> Result<u64, ProgramError>
Expand description

Checked ceiling division: ceil(a / b).

Rounds up instead of truncating. Use for fee calculations and minimum outputs where truncation would favor the user at the protocol’s expense.