Skip to content

Commit

Permalink
Add ten_to_the_u64
Browse files Browse the repository at this point in the history
  • Loading branch information
akubera committed Mar 5, 2024
1 parent 0619954 commit a0c7df4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/arithmetic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pub(crate) fn ten_to_the(pow: u64) -> BigInt {
ten_to_the_uint(pow).into()
}

/// Return 10^{pow} as u64
pub(crate) fn ten_to_the_u64(pow: u8) -> u64 {
debug_assert!(pow < 20);
10u64.pow(pow as u32)
}

/// Return 10^pow
pub(crate) fn ten_to_the_uint(pow: u64) -> BigUint {
if pow < 20 {
Expand Down

0 comments on commit a0c7df4

Please sign in to comment.