Skip to content

Additional arithmetic functions #10

Description

@jonasmittun

Add implementations from https://doc.rust-lang.org/std/primitive.u32.html where we focus on those that aren't bit manipulation. Overflow, checked, unchecked and strict should be easy.

Current: overflowing_, checked_, wrapping_*, saturating_sub, div_ceil.

  • saturating_add / saturating_mul — complete the saturating family
  • wrapping_sub / wrapping_mul — complete wrapping family
  • checked_sub / checked_div — complete checked family
  • pow / checked_pow — exponentiation (relevant to crypto proofs like MLKEM)
  • abs / abs_diff — absolute value for signed types
  • min / max / clamp — bounded value reasoning

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions