guile-devel
[Top][All Lists]
Advanced

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

Re: bit-extract seems broken.


From: Michael Livshin
Subject: Re: bit-extract seems broken.
Date: 19 Dec 2000 19:49:58 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (20 Minutes to Nikko)

Martin Grabmueller <address@hidden> writes:

> > From: Dirk Herrmann <address@hidden>
> > Date: Tue, 19 Dec 2000 17:25:57 +0100 (MET)
> > 
> > I just wanted to fix it, but realized that it is not really clear to me
> > what bit-extract should do with negative numbers.  Opinions?  Should we
> > for example only allow non-negative arguments?
> 
> I'd say: Forbid negative arguments.  The only interpretation I could
> imagine would be `count from the left', but since bignums are allowed
> that does not make much sense.

FWIW.

Common Lisp bitwise logic operators (ash etc.) operate on any
integers, including negative.  they simply pretend that the argument
is in two's complement form.

can't see what's wrong with that.  it even gives intuitive answers:

> (ash -1 3)
-8

-- 
I'm on a seafood diet -- I see food and I eat it.           -- anonymous




reply via email to

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