Description
It looks like the test_tru
5858
nc
reference implementation is math.trunc
for at least a subset of the checks. I noticed that for some large values there is a mismatch with both the pykokkos
(ultimately C++) version of trunc
and math.trunc
, which causes the conformance test to fail. I see the same thing in NumPy as well--do you have a suggestion on how I should proceed here? Is this effectively related to arbitrary precision Python integers, etc.?
I'll just use NumPy rather than pykokkos below, to keep things familiar:
>>> import math
>>> import numpy as np
>>> math.trunc(9007199254740993)
9007199254740993
>>> np.trunc(9007199254740993)
9007199254740992.0
And then in the conformance testing: pytest array_api_tests/test_operators_and_elementwise_functions.py::test_trunc
AssertionError: out[0]=9007199254740992, but should be trunc(x[0])=9007199254740993 [trunc()]
Would you say that my reference implementation in pykokkos
and the exposed NumPy trunc
are both wrong here, and the test suite is correct or?