From a0c7df42eb44df8ed47ed1efba2da33410a17192 Mon Sep 17 00:00:00 2001 From: Andrew Kubera Date: Tue, 5 Mar 2024 01:19:01 -0500 Subject: [PATCH] Add ten_to_the_u64 --- src/arithmetic/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/arithmetic/mod.rs b/src/arithmetic/mod.rs index 9580441..46644bc 100644 --- a/src/arithmetic/mod.rs +++ b/src/arithmetic/mod.rs @@ -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 {