Skip to content

Commit ecb475a

Browse files
committed
Improve: Log operand descriptor
1 parent 69e3a94 commit ecb475a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

include/simsimd/types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ SIMSIMD_INTERNAL void _simsimd_i16_sadd(simsimd_i16_t const *a, simsimd_i16_t co
876876
}
877877
SIMSIMD_INTERNAL void _simsimd_i32_sadd(simsimd_i32_t const *a, simsimd_i32_t const *b, simsimd_i32_t *r) {
878878
simsimd_i64_t result = (simsimd_i64_t)*a + (simsimd_i64_t)*b;
879-
*r = (result > 2147483647) ? 2147483647 : (result < -2147483648 ? -2147483648 : (simsimd_i32_t)result);
879+
*r = (result > 2147483647ll) ? 2147483647ll : (result < -2147483648ll ? -2147483648ll : (simsimd_i32_t)result);
880880
}
881881
SIMSIMD_INTERNAL void _simsimd_i64_sadd(simsimd_i64_t const *a, simsimd_i64_t const *b, simsimd_i64_t *r) {
882882
//? We can't just write `-9223372036854775808ll`, even though it's the smallest signed 64-bit value.

scripts/test.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1675,8 +1675,10 @@ def validate(a, b, inplace_simsimd):
16751675
rtol=SIMSIMD_RTOL,
16761676
err_msg=f"""
16771677
Result mismatch for ({a.dtype} {operator} {b.dtype})
1678-
First argument: {a}
1679-
Second argument: {b}
1678+
First descriptor: {a.__array_interface__}
1679+
Second descriptor: {b.__array_interface__}
1680+
First operand: {a}
1681+
Second operand: {b}
16801682
SimSIMD result: {result_simsimd}
16811683
NumPy result: {result_numpy}
16821684
""",

0 commit comments

Comments
 (0)