64-bit integer testing is broken
argilo opened this issue · comments
Clayton Smith commented
The icompare
function casts all inputs to int
before comparing & printing them. This prevents errors in upper bits from being caught, and makes it difficult to diagnose failures.
Lines 463 to 480 in e853e9b
Johannes Demel commented
We could use long long int
cf. Int types.
However, the fundamental int types just feel broken.
I assume we should #include <cstdint>
and use fixed width integer types.
In this specific case int64_t
would be correct. Though, this type is marked optional.
Johannes Demel commented
If we change this line:
Line 493 in d5b317c
to
if (((unsigned int)abs(int64_t(((t*)(in1))[i]) - int64_t(((t*)(in2))[i]))) > tol) {
we should be good. Technically, a #include <cstdint>
line is required as well.