|Bill Allombert on Sat, 28 Sep 2002 10:56:24 +0200|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|Re: t_INT API|
On Fri, Sep 27, 2002 at 12:33:57PM -0700, Ilya Zakharevich wrote: > On Fri, Sep 27, 2002 at 01:40:49PM +0200, Bill Allombert wrote: > > I propose to use the following interface: > > #define int_MSW(x) > > x being a t_INT, return a pointer to the most significant word of an t_INT. > > > > #define int_LSW(x) > > x being a t_int, return a pointer to the least significant word of an t_INT. > > > > #define int_nextW(x) > > x pointing to a mantissa word, return the next (more significant) mantissa word. > > > > #define int_precW(x) > > x pointing to a mantissa word, return the previous (less significant) mantissa word. > > [Do not see any usage for next/prec.] I need a way to access the word > number n. next/prec are needed for left-right binary style algorithms. And I agree, we need a way to access word n. maybe: #define int_word(x,n) One question though: this system is fine if we only have to support PARI and current GMP format. However should we had a provision for other formats, e.g. formats that use less than 32 bits per words like "GMP with nails" ??? In this case we could only provide a macro to access bits individualy. But that maybe slower and an overkill. Cheers, Bill.