guile-devel
[Top][All Lists]
Advanced

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

Re: doco on bitwise logicals


From: Kevin Ryde
Subject: Re: doco on bitwise logicals
Date: Tue, 06 May 2003 09:35:52 +1000
User-agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux)

Rob Browning <address@hidden> writes:
>
> Two things that I thought of were wondering if we could think of
> something other than "highest FOO bit", that might be clearer.  (Would
> "most significant FOO bit" be appropriate or more confusing?)

Yes, most significant would be good.

> and wondering if you might want to include some negative n examples
> in the integer-length verbage and example set.

Yep, new text:

 - Scheme Procedure: integer-length n
 - C Function: scm_integer_length (n)
     Return the number of bits necessary to represent N.

     For positive N this is how many bits to the most significant one
     bit.  For negative N it's how many bits to the most significant
     zero bit in twos complement form.

          (integer-length #b10101010) => 8
          (integer-length #b1111)     => 4
          (integer-length 0)          => 0
          (integer-length -1)         => 0
          (integer-length -256)       => 8
          (integer-length -257)       => 9




reply via email to

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