[PPL-devel] Re: [Yap-users] Big problems with not-so-big numbers

Vitor Santos Costa vscosta at gmail.com
Wed Feb 1 15:00:25 CET 2006


Thanks for the report and sorry for that, I was using an int where I
should be using a long int. Should be ok now.

I also made a few small changes to hopefully better explit the x68_64
architecture. I am curious on any feedback or any issues you find.

Cheers

Vitor

On 1/25/06, Roberto Bagnara <bagnara at cs.unipr.it> wrote:
> 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
>
> --
> Prof. Roberto Bagnara
> Computer Science Group
> Department of Mathematics, University of Parma, Italy
> http://www.cs.unipr.it/~bagnara/
> mailto:bagnara at cs.unipr.it
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Yap-users mailing list
> Yap-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/yap-users
>




More information about the PPL-devel mailing list