Skip to content

test_math fails on Windows #126252

@Eclips4

Description

@Eclips4

Bug report

Bug description:

./python -m test -v test_math
======================================================================
ERROR: test_fma_overflow (test.test_math.FMATests.test_fma_overflow)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2801, in test_fma_overflow
    self.assertEqual(math.fma(a, b, -c),
                     ~~~~~~~~^^^^^^^^^^
OverflowError: overflow in fma

======================================================================
FAIL: test_fma_zero_result (test.test_math.FMATests.test_fma_zero_result)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2760, in test_fma_zero_result
    self.assertIsNegativeZero(math.fma(tiny, -tiny, 0.0))
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2876, in assertIsNegativeZero
    self.assertTrue(
    ~~~~~~~~~~~~~~~^
        value == 0 and math.copysign(1, value) < 0,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        msg="Expected a negative zero, got {!r}".format(value)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: False is not true : Expected a negative zero, got 0.0

======================================================================
FAIL: test_random (test.test_math.FMATests.test_random)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\eclips4\programming\cpython\Lib\test\test_math.py", line 2859, in test_random
    self.assertEqual(math.fma(a, b, c), expected)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 0.5506672157701096 != 0.5506672157701097

----------------------------------------------------------------------
Ran 87 tests in 14.275s

FAILED (failures=2, errors=1, skipped=2)
test test_math failed
test_math failed (1 error, 2 failures)

== Tests result: FAILURE ==

1 test failed:
    test_math

Total duration: 16.3 sec
Total tests: run=87 failures=2 skipped=2
Total test files: run=1/1 failed=1
Result: FAILURE

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsstdlibStandard Library Python modules in the Lib/ directorytestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions