guile-devel
[Top][All Lists]
Advanced

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

Re: bit-extract seems broken.


From: Jim Blandy
Subject: Re: bit-extract seems broken.
Date: 13 Jan 2001 11:38:49 -0500

Dirk Herrmann <address@hidden> writes:
> On 19 Dec 2000, Jim Blandy wrote:
> > Dirk Herrmann <address@hidden> writes:
> > > On 19 Dec 2000, Jim Blandy wrote:
> > > > Negative values for the @var{start} and @var{end} arguments to
> > > > bit-extract aren't meaningful, as they index bits the value doesn't
> > > > have.  A negative start or end should be an error.
> > > 
> > > Right, but what about extracting bits from a negative number?
> > 
> > Oh.  It should behave as if it were infinitely 1-extended.
> 
> This brings me to another question:  It seems that in a lot of places it
> is assumed that the machine uses the two's complement representation for
> fixnums.  I assume that this is the standard case, or should we try to
> cover other representations as well?

I think the primitives should be defined to act as if the value were
using two's complement.  How numbers are actually represented is a
separate issue.

I can't think of any machines in widespread use that don't use two's
complement.




reply via email to

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