From 252ebc85bf15023f03c9bb33c6ed887507a14264 Mon Sep 17 00:00:00 2001 From: shaharsamocha7 <70577611+shaharsamocha7@users.noreply.github.com> Date: Wed, 13 Mar 2024 16:54:08 +0200 Subject: [PATCH] Remove next pow of two util func. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change is [Reviewable](https://reviewable.io/reviews/starkware-libs/stwo/465) --- src/math/utils.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/math/utils.rs b/src/math/utils.rs index a5cd43f18..ffd6d3d38 100644 --- a/src/math/utils.rs +++ b/src/math/utils.rs @@ -14,11 +14,6 @@ pub fn log2_floor(n: usize) -> usize { num_of_bits - n.leading_zeros() as usize - 1 } -#[inline] -pub fn next_pow_two(n: usize) -> usize { - 2_usize.pow(log2_ceil(n) as u32) -} - #[inline] pub fn prev_pow_two(n: usize) -> usize { 2_usize.pow(log2_floor(n) as u32) @@ -52,9 +47,7 @@ pub fn egcd(x: isize, y: isize) -> (isize, isize, isize) { #[cfg(test)] mod tests { - use crate::math::utils::{ - egcd, log2_ceil, log2_floor, next_pow_two, prev_pow_two, usize_div_ceil, - }; + use crate::math::utils::{egcd, log2_ceil, log2_floor, prev_pow_two, usize_div_ceil}; #[test] fn log2_ceil_test() { @@ -72,13 +65,6 @@ mod tests { assert_eq!(log2_floor(65), 6); } - #[test] - fn next_power_of_two_test() { - assert_eq!(next_pow_two(1), 1); - assert_eq!(next_pow_two(2), 2); - assert_eq!(next_pow_two(3), 4); - } - #[test] fn prev_power_of_two_test() { assert_eq!(prev_pow_two(1), 1);