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

*To*: Bradley Lucier <lucier@xxxxxxxxxxxxxxx>*Subject*: Re: Arithmetic issues*From*: Alan Watson <a.watson@xxxxxxxxxxxxxxxx>*Date*: Fri, 28 Oct 2005 15:00:08 -0700*Cc*: srfi-77@xxxxxxxxxxxxxxxxx*Delivered-to*: srfi-77@xxxxxxxxxxxxxxxxx*In-reply-to*: <AC698494-051F-4CDC-93A4-44968ACC71D9@xxxxxxxxxxxxxxx>*Organization*: Centro de Radioastronomía y Astrofísica UNAM*References*: <y9lzmp775oz.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <20051018173639.GC13524@NYCMJCOWA2> <43626CE4.4060703@xxxxxxxxxxx> <43627DA5.1000708@xxxxxxxxxxxxxxxx> <AC698494-051F-4CDC-93A4-44968ACC71D9@xxxxxxxxxxxxxxx>*User-agent*: Mozilla Thunderbird 1.0 (X11/20050317)

Thanks very much for the reference! It looks very useful.

In an implementation written in C (i.e., without access to the carryflag) running on a 32-bit processor, it might make sense to use16-bit fixnums to make it easy to check for overflow and the need forbignums.This is not really necessary. See "Hacker's Delight" by Henry S.Warren, who gives algorithms for checking for overflow in the basicarithmetic operations for signed and unsigned arithmetic.

Of course, in a sense, you have access to the carry flag because"long long" is at least 64-bits.I'm no C expert, but somehow I doubt that this is true. (I first wrote"strictly true", but I guess it's either true or false.)

Regards, Alan -- Dr Alan Watson Centro de Radioastronomía y Astrofísica Universidad Astronómico Nacional de México

**References**:**Arithmetic issues***From:*Michael Sperber

**Re: Arithmetic issues***From:*John.Cowan

**Re: Arithmetic issues***From:*Per Bothner

**Re: Arithmetic issues***From:*Alan Watson

**Re: Arithmetic issues***From:*Bradley Lucier

- Prev by Date:
**Re: Arithmetic issues** - Next by Date:
**NaN's** - Previous by thread:
**Re: Arithmetic issues** - Next by thread:
**Re: Arithmetic issues** - Index(es):