[Openmcl-devel] Openmcl-devel Digest, Vol 111, Issue 2

Gary Byers gb at clozure.com
Mon Jan 7 00:49:54 PST 2013



On Mon, 7 Jan 2013, Pascal J. Bourguignon wrote:

> Toomas Altosaar <toomas.altosaar at gmail.com> writes:
>
>>> The good news: this also doesn't seem to be ARM-specific; as far as
>>> I can tell,
>>>
>>> (* most-negative-fixnum some-bignum) ; either arg order
>>>
>>> will produce an incorrect result on all architectures that CCL runs on.
>>> (The incorrect result will also likely differ on each invocation.)
>>>
>>> The bad news: this bug has likely been around forever.

He said, staring at buggy code in a source file named 'l0-bignum32.lisp' and
forgetting that that code isn't used in 64-bit implementations.

Welcome to Clozure Common Lisp Version 1.9-dev-r15542M-trunk  (DarwinX8632)!
? (- (* 9126805504 -536870912) -4899916394579099648)
4431479478744514560
?

and even

  Welcome to Clozure Common Lisp Version 1.9-dev-r15508  (LinuxPPC32)!
? (- (* 9126805504 -536870912) -4899916394579099648)
2702055779694804992
?

So yes, it had been around forever and it only affected 32-bit CCL.

>>>
>>> It should be fixed in the trunk now.
>>
>> Haven't updated for a while, gave the right answer three times in a row with:
>>
>> Welcome to Clozure Common Lisp Version 1.8-dev-r15233M-trunk  (DarwinX8664)!
>>
>> ?(- (* 9126805504 -536870912) -4899916394579099648)
>> 0
>
> You have a 64-bit ccl, where most-negative-fixnum is
> -1152921504606846976, not -536870912.
>
>
> On the other hand:
>
>    cl-user> (lisp-implementation-version)
>    "Version 1.8-r15286M  (Linuxx8664)"
>    cl-user> most-negative-fixnum
>    -1152921504606846976
>    cl-user> (* most-negative-fixnum 1000000000000000000000000)
>    -1152921504606846976000000000000000000000000
>    -1152921504606846976
>                       1000000000000000000000000
>
> This seems correct to me.
>
> -- 
> __Pascal Bourguignon__                     http://www.informatimago.com/
> A bad day in () is better than a good day in {}.
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list