Correct value of sys.float_info.min · RustPython/RustPython@ab444d0 · GitHub
Skip to content

Commit ab444d0

Browse files
Árni DagurArniDagur
authored andcommitted
Correct value of sys.float_info.min
1 parent da2bd5e commit ab444d0

3 files changed

Lines changed: 18 additions & 14 deletions

File tree

Lib/test/test_complex.py

Lines changed: 6 additions & 0 deletions

Lib/test/test_math.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,16 +1970,15 @@ def test_nextafter(self):
19701970
self.assertEqualSign(math.nextafter(+0.0, -0.0), -0.0)
19711971

19721972
# around 0.0
1973-
# TODO: RUSTPYTHON
1974-
# smallest_subnormal = sys.float_info.min * sys.float_info.epsilon
1975-
# self.assertEqual(math.nextafter(+0.0, INF), smallest_subnormal)
1976-
# self.assertEqual(math.nextafter(-0.0, INF), smallest_subnormal)
1977-
# self.assertEqual(math.nextafter(+0.0, -INF), -smallest_subnormal)
1978-
# self.assertEqual(math.nextafter(-0.0, -INF), -smallest_subnormal)
1979-
# self.assertEqualSign(math.nextafter(smallest_subnormal, +0.0), +0.0)
1980-
# self.assertEqualSign(math.nextafter(-smallest_subnormal, +0.0), -0.0)
1981-
# self.assertEqualSign(math.nextafter(smallest_subnormal, -0.0), +0.0)
1982-
# self.assertEqualSign(math.nextafter(-smallest_subnormal, -0.0), -0.0)
1973+
smallest_subnormal = sys.float_info.min * sys.float_info.epsilon
1974+
self.assertEqual(math.nextafter(+0.0, INF), smallest_subnormal)
1975+
self.assertEqual(math.nextafter(-0.0, INF), smallest_subnormal)
1976+
self.assertEqual(math.nextafter(+0.0, -INF), -smallest_subnormal)
1977+
self.assertEqual(math.nextafter(-0.0, -INF), -smallest_subnormal)
1978+
self.assertEqualSign(math.nextafter(smallest_subnormal, +0.0), +0.0)
1979+
self.assertEqualSign(math.nextafter(-smallest_subnormal, +0.0), -0.0)
1980+
self.assertEqualSign(math.nextafter(smallest_subnormal, -0.0), +0.0)
1981+
self.assertEqualSign(math.nextafter(-smallest_subnormal, -0.0), -0.0)
19831982

19841983
# around infinity
19851984
largest_normal = sys.float_info.max
@@ -2002,9 +2001,8 @@ def test_ulp(self):
20022001
self.assertEqual(math.ulp(2 ** 64), 4096.0)
20032002

20042003
# min and max
2005-
# TODO: RUSTPYTHON
2006-
# self.assertEqual(math.ulp(0.0),
2007-
# sys.float_info.min * sys.float_info.epsilon)
2004+
self.assertEqual(math.ulp(0.0),
2005+
sys.float_info.min * sys.float_info.epsilon)
20082006
self.assertEqual(math.ulp(FLOAT_MAX),
20092007
FLOAT_MAX - math.nextafter(FLOAT_MAX, -INF))
20102008

vm/src/sysmodule.rs

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)