aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-core/src')
-rw-r--r--azalea-core/src/math.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs
index d5fe5af9..105069ef 100644
--- a/azalea-core/src/math.rs
+++ b/azalea-core/src/math.rs
@@ -63,7 +63,7 @@ pub fn lerp<T: num_traits::Float>(amount: T, a: T, b: T) -> T {
}
pub fn ceil_log2(x: u32) -> u32 {
- u32::BITS - x.leading_zeros()
+ u32::BITS - x.saturating_sub(1).leading_zeros()
}
pub fn fract(x: f64) -> f64 {