See https://github.com/angr/angr/commit/d4a3f058e06a78361b60e08544ea4ae8f735e0cf diff --git a/tests/factory/test_callable.py b/tests/factory/test_callable.py index 22602c15e..f6e5e49df 100755 --- a/tests/factory/test_callable.py +++ b/tests/factory/test_callable.py @@ -3,6 +3,8 @@ from __future__ import annotations __package__ = __package__ or "tests.factory" # pylint:disable=redefined-builtin +import functools +import operator import os import unittest @@ -135,7 +137,12 @@ class TestCallable(unittest.TestCase): # not almost equal!! totally equal!!! z3 is magic, if kinda slow!!!!! for arg_conc in args_conc: assert arg_conc > 1.0 - assert sum(args_conc) == 27.7 + # Sum sequentially like the program does. Since Python 3.12, builtin + # sum() uses Neumaier compensated summation for floats, which is MORE + # accurate than the program's naive left-to-right addition and so can + # disagree with the (exactly satisfied) symbolic result by an ulp. + seq_sum = functools.reduce(operator.add, args_conc) + assert seq_sum == 27.7 def test_fauxware_armel(self): self.run_fauxware("armel")