Skip to content

Commit 893f86e

Browse files
Respond to reviewer comments
1 parent beeb044 commit 893f86e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Lib/test/test_statistics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,8 +1472,6 @@ def test_regression_20561(self):
14721472
d = Decimal('1e4')
14731473
self.assertEqual(statistics.mean([d]), d)
14741474

1475-
# TODO: RUSTPYTHON division converts ints to floats before dividing, not after
1476-
@unittest.expectedFailure
14771475
def test_regression_25177(self):
14781476
# Regression test for issue 25177.
14791477
# Ensure very big and very small floats don't overflow.

stdlib/src/math.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ mod math {
157157
}
158158

159159
/// Generates the base-2 logarithm of a BigInt `x`
160-
fn ilog2(x: &BigInt) -> f64 {
160+
fn int_log2(x: &BigInt) -> f64 {
161161
// log2(x) = log2(2^n * 2^-n * x) = n + log2(x/2^n)
162162
// If we set 2^n to be the greatest power of 2 below x, then x/2^n is in [1, 2), and can
163163
// thus be converted into a float.
@@ -179,7 +179,7 @@ mod math {
179179
}
180180
Err(float_err) => {
181181
if let Ok(x) = x.try_int(vm) {
182-
Ok(ilog2(x.as_bigint()))
182+
Ok(int_log2(x.as_bigint()))
183183
} else {
184184
// Return the float error, as it will be more intuitive to users
185185
Err(float_err)

0 commit comments

Comments
 (0)