
Vitor Santos Costa wrote:
It should be fixed in the CVS. Te c-interface was doing the right thing, but the scanner was reading this number as a bignum (because ithe absolute value is larger than MAX_INT). I fixed the bignum code to do the right check for whether you can represent the number as a small int.
Dear Vitor,
thanks for the fix. Now things work on 32-bit architectures, but the problem seems to persist for 64-bit ones. Here is what happens on an x86_64:
$ yap % Restoring file /home2/bagnara/lib/Yap/startup YAP version Yap-5.1.0 ?- load_foreign_files(['bug'],[],init). yes ?- long_min(M). M = -9223372036854775808 ? yes ?- long_min(M), M == -9223372036854775808. no ?- long_min(M), M = -9223372036854775808. no ?- long_min(M), M = 0 - 9223372036854775808. no ?- long_min(M), M1 is abs(M). M = M1 = -9223372036854775808 ? yes ?- $
The code is exactly as in my original report. All the best,
Roberto