You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/libbytesize_unittest.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -436,12 +436,12 @@ def testSgn(self):
436
436
deftestTrueDiv(self):
437
437
x=SizeStruct.new_from_str("1024 B")
438
438
y=SizeStruct.new_from_str("-102.4 B") # rounds to whole bytes
439
-
divResult=float(x.true_div(y)[:15].replace(locale.nl_langinfo(locale.RADIXCHAR), ".")) # just some number to cover accurancy and not cross max float range
439
+
divResult=float(x.true_div(y)[:15].replace(locale.nl_langinfo(locale.RADIXCHAR), ".")) # just some number to cover accuracy and not cross max float range
440
440
self.assertAlmostEqual(divResult, 1024.0/-102.0)
441
441
442
442
x=SizeStruct.new_from_str("1 MiB")
443
443
y=SizeStruct.new_from_str("1 KiB")
444
-
divResult=float(x.true_div(y)[:15].replace(locale.nl_langinfo(locale.RADIXCHAR), ".")) # just some number to cover accurancy and not cross max float range
444
+
divResult=float(x.true_div(y)[:15].replace(locale.nl_langinfo(locale.RADIXCHAR), ".")) # just some number to cover accuracy and not cross max float range
445
445
self.assertAlmostEqual(divResult, 1024.0)
446
446
#enddef
447
447
@@ -774,8 +774,8 @@ def testTrueDivInt(self):
774
774
@requires_locales({'en_US.UTF-8'})
775
775
deftestPowerComputationRoundingIssues(self):
776
776
"""Test cases that expose rounding differences when using floating-point arithmetic.
777
-
778
-
These test cases were discovered by fuzzing and demonstrate that both GMP and MPFR
777
+
778
+
These test cases were discovered by fuzzing and demonstrate that both GMP and MPFR
779
779
can produce incorrect results due to floating-point rounding errors: half of these
780
780
fail using GMP floating-point arithmetic, and half fail using MPFR floating-point
781
781
arithmetic. They all pass using rational arithmetic, so this can be considered a
0 commit comments