On 28 September 2012 22:15, Brian Gladman <b...@gladman.plus.com> wrote: > -----Original Message----- From: Bill Hart > Sent: Friday, September 28, 2012 9:39 PM > To: mpir-devel@googlegroups.com > > Subject: Re: [mpir-devel] Re: MPIR 2.6 release progress > > Does anyone have any idea about this t-set_sx code. > > It sets up an array of structs (not all fully populated): > > { 0L, 0 }, > { 1L, 1, { 1 } }, > { -1L, -1, { 1 } }, > > #if GMP_NUMB_BITS >= BITS_PER_UINTMAX > { INTMAX_MAX, 1, { INTMAX_MAX, 0 } }, > { -INTMAX_MAX, -1, { INTMAX_MAX, 0 } }, > #else > { INTMAX_MAX, 2, { INTMAX_MAX & GMP_NUMB_MASK, INTMAX_MAX >> > GMP_NUMB_BITS } }, > { -INTMAX_MAX, -2, { INTMAX_MAX & GMP_NUMB_MASK, INTMAX_MAX >> > GMP_NUMB_BITS } }, > #endif > > #if GMP_NUMB_BITS >= BITS_PER_UINTMAX > { INTMAX_MIN, -1, { -INTMAX_MIN, 0 } }, > #else > { INTMAX_MIN, -2, { -INTMAX_MIN & GMP_NUMB_MASK, -INTMAX_MIN >> > GMP_NUMB_BITS } }, > #endif > > In each case it gives a value n which is read in using mpz_set_sx, > followed by a number of limbs. Then it gives a pair of limbs to > compare with. > > But I cannot understand how the last set is supposed to work. > > ============================== > > Mathematically, -INTMAX_MIN is what is needed on the right but integer > wraparound happens to make this redundant. > > I don't recall that there was any more to it than this. > >
I'm not sure I understand why -INTMAX_MIN is needed mathematically. After all, INTMAX_MIN is already a negative integer, so -INTMAX_MIN would be positive, in which case the answer would be wrong, due to truncation. I personally think that both codewise and mathematically, what is needed is just INTMAX_MIN. I think I am going to change them to INTMAX_MIN instead of -INTMAX_MIN. After that, everything but the paperwork is done on the linux side. What's the Windows todo list looking like? Are we getting near the time where we can issue an alpha release? Bill. -- You received this message because you are subscribed to the Google Groups "mpir-devel" group. To post to this group, send email to mpir-devel@googlegroups.com. To unsubscribe from this group, send email to mpir-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/mpir-devel?hl=en.