meta-comment on typing Per Bothner (05 Oct 2005 17:35 UTC)
Re: meta-comment on typing John.Cowan (05 Oct 2005 22:00 UTC)
Re: meta-comment on typing Per Bothner (05 Oct 2005 22:14 UTC)
Re: meta-comment on typing John.Cowan (06 Oct 2005 04:55 UTC)
Re: meta-comment on typing Michael Sperber (06 Oct 2005 06:03 UTC)
Re: meta-comment on typing Per Bothner (06 Oct 2005 15:35 UTC)
[SRFI 77] integer-length and integer-sqrt Jens Axel Søgaard (06 Oct 2005 15:54 UTC)
Re: meta-comment on typing Michael Sperber (06 Oct 2005 16:17 UTC)

[SRFI 77] integer-length and integer-sqrt Jens Axel Søgaard 06 Oct 2005 15:54 UTC

Thanks for a very interesting number srfi. Efficient
(and portable) arithmetic in Scheme has been on my wish
list for a long time.

I propose adding the following two operations on integers.

The first is INTEGER-LENGTH from CLHS

     <http://clhs.lisp.se/Body/f_intege.htm>

which returns the number of bits needed to represent a given
integer in binary two's-complement format. Although it
is possible to define INTEGER-LENGTH as a library function,
it will be more efficient as a primitive, since it can
exploit the internal representation of an integer.

The second is INTEGER-SQRT, which is discussed here:

<http://groups.google.com/group/comp.lang.scheme/browse_frm/thread/dc06e91e306cf488/a9cf92f425bb3db1?lnk=st&q=lucier+integer-sqrt&rnum=1&hl=en#a9cf92f425bb3db1>

I consider INTEGER-SQRT just as natural an operation as GCD and LCM
when it comes to number theoretical calculations. But this may be
a matter of taste.

--
Jens Axel Søgaard