bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] "Largest integer" isnt' really largest?


From: Frederick H. Pitts
Subject: Re: [Bug-apl] "Largest integer" isnt' really largest?
Date: Tue, 11 Mar 2014 17:29:08 -0500

Gentle people,

        If one executes

        i ← 0
        63 1 ⍴ { ⍵ , i ← ¯1 + 2 × i + 1 }¨ 1 + ⍳ 63

one should get a 2-column table of bit count and corresponding maximum
positive representable integer (assuming high order bit is a sign bit).
The maximum integer should be odd.  Running the above on GnuAPL (as well
as ngnAPL), reveals that maximum integer goes even at bit count 55.  It
is strange that two independent implementations of APL have the same
bug.

        Hope the above helps isolate the problem.

Regards,

Fred


On Tue, 2014-03-11 at 10:54 -0500, Frederick H. Pitts wrote:
> Gentle people,
> 
>       And 
> 
>       9223372036854775807 + ¯9223372036854775808
> 0
> 
> is not correct either.
> 
> Regards,
> 
> Fred
> 
> On Tue, 2014-03-11 at 23:32 +0800, Elias Mårtenson wrote:
> > Running ⎕SYL shows the following:
> > 
> > 
> >       largest integer                         9223372036854775807
> > 
> > 
> > Trying to subtract one from this value gives a weird result:
> > 
> > 
> >       9223372036854775807-1
> > ¯9223372036854775808
> > 
> > 
> > Regards,
> > Elias
> 
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]