Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-03-29 21:30:21


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/29/2010 09:09 PM, Scott McMurray wrote:

>> Close, but not quite: the inverse of zero is zero.
>
> Uh, what? I thought that the point of an inverse is that
> multiplication gives 1 -- that's certainly what I read at
> http://en.wikipedia.org/wiki/Modular_multiplicative_inverse

<sigh> If you guys are going to make me eat crow so often, could I at
least have some ketchup?

> Wouldn't the modulo inverse of 0 be a NaN just like the result of 1/0?

Yes, it would.

In my defense, I *did* have a reason to think that it was valid -- if
you list the inverses of all the numbers by a particular prime, you're
supposed to get every number back again, each a single time, in a
different order. The only way that's true is if zero were its own inverse.

That being the case, zero *would* be a valid response for those two
functions. If I'm convinced that the Not-a-Number value shouldn't be
included in the library, that's probably how I'll do it.
- --
Chad Nelson
Oak Circle Software, Inc.
*
*
*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuxVC0ACgkQp9x9jeZ9/wQmkQCgxtjMY3e9AlkoWaH5kEsKEE/d
JjAAoKXwgfeuQHXXBNpa9QiuAkWan1sc
=0Fg/
-----END PGP SIGNATURE-----


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk