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

This page is part of the web mail archives of SRFI 77 from before July 7th, 2015. The new archives for SRFI 77 contain all messages, not just those from before July 7th, 2015.

*To*: srfi-77@xxxxxxxxxxxxxxxxx*Subject*: [SRFI 77] integer-length and integer-sqrt*From*: Jens Axel Søgaard <jensaxel@xxxxxxxxxxxx>*Date*: Thu, 06 Oct 2005 17:54:23 +0200*Delivered-to*: srfi-77@xxxxxxxxxxxxxxxxx*In-reply-to*: <43454429.1090307@xxxxxxxxxxx>*References*: <43440EDA.1020900@xxxxxxxxxxx> <y9lfyrfw5bj.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> <43454429.1090307@xxxxxxxxxxx>*User-agent*: Mozilla Thunderbird 1.0.2 (Windows/20050317)

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

**References**:**meta-comment on typing***From:*Per Bothner

**Re: meta-comment on typing***From:*Michael Sperber

**Re: meta-comment on typing***From:*Per Bothner

- Prev by Date:
**Re: meta-comment on typing** - Next by Date:
**Re: meta-comment on typing** - Previous by thread:
**Re: meta-comment on typing** - Next by thread:
**Re: meta-comment on typing** - Index(es):