|
From: David H. <dmh...@ma...> - 2007-04-18 00:43:37
|
On Apr 17, 2007, at 6:46 PM, William Hart wrote: > I can't believe this is an unsigned type. So when we > use it for limbs in Zpoly_mpn_t the sign limb can't be > compared to 0 to see if it is negative. Instead I have > to specifically do a comparison with -1L. That's kind > of crap because it means we can't just use any old > negative number for a negative sign. It has to be a > specific number so that we can do an easy comparison. Well, there's also mp_limb_signed_t (or perhaps it's mp_signed_limb_t? i can't remember), but that doesn't really help you, since the array has to be of a single type. Perhaps it's worth having macros COEFF(poly, n) which returns a pointer to the limbs of the nth coefficient of poly, and also SIGN(poly, n) which returns the sign limb of the nth coefficient, casted to a signed type. Not sure if those are the right names for the macros, but something like that would certainly simplify a lot of the Zpoly_mpn code. david |