On current main, the array-agnostic path gives two results that disagree with the displayed tolerance equation when using array_api_strict:
import array_api_extra as xpx
import array_api_strict as xp
def check(a, b, atol, rtol):
return bool(xpx.isclose(xp.asarray(a, dtype=xp.int8),
xp.asarray(b, dtype=xp.int8),
atol=atol, rtol=rtol))
print(check(0, 100, 30, 1.0)) # False; 100 <= 30 + 100
print(check(15, 10, 0, 0.4)) # True; 5 > 0.4 * 10
The first result appears to come from integer overflow in the tolerance sum; the second from truncating 1/rtol to an integer. The Notes currently introduce the tolerance equation for floating-point values. For integer inputs, should the agnostic path compare exact integer differences against the supplied scalar tolerances, or follow NumPy-like floating evaluation (including rounding large int64/uint64 values)? That choice affects a fix that also preserves large-integer comparisons.
On current
main, the array-agnostic path gives two results that disagree with the displayed tolerance equation when usingarray_api_strict:The first result appears to come from integer overflow in the tolerance sum; the second from truncating
1/rtolto an integer. The Notes currently introduce the tolerance equation for floating-point values. For integer inputs, should the agnostic path compare exact integer differences against the supplied scalar tolerances, or follow NumPy-like floating evaluation (including rounding largeint64/uint64values)? That choice affects a fix that also preserves large-integer comparisons.