Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-04-02 15:17:30


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

On 04/02/2010 02:50 PM, Scott McMurray wrote:

>> I can agree with all of those except 0 * Inf and 0 * -Inf. If I
>> remember correctly, zero times anything is zero, and that would
>> apply to infinities too. Or am I missing something again?
>
> It's because if the 0 came from x/Inf, the "0*Inf" is more like a
> x*(Inf/Inf).
>
> We used to call it the difference between a "real zero" and a
> "calculus zero". The former times anything -- even infinity -- is
> zero, but the latter leads to indeterminate forms.

Since this is an integer library, x/Inf would be rounded to zero, even
if it isn't technically zero. Then 0*Inf would also equal zero.

>> :-) I'm not sure how useful the operations on infinities would be,
>> but it looks like it would be easy enough to add them.
>
> I doubt anyone would use them directly. I see them as there for
> defaults in cases where you need to provide something, but there's no
> finite value that's acceptable -- the interval example, or a modulo
> where you want the full value, for instance -- and as a way to
> intelligently propegate the bad_alloc error code.

I can agree with most of that, but I still can't see how returning an
infinity value on a bad_alloc would help anyone. It *isn't* infinity,
it's just a number that can't (presently) be represented. NaN may not be
completely appropriate for that, but infinity seems even less so, since
it implies something that was arrived at by definite calculation.
- --
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/

iEYEARECAAYFAku2QsoACgkQp9x9jeZ9/wS6OACeO5qsQEkXbqaf6H8IcQmcX90H
lmsAoJ5bQZzs8ab4er1Om56SvEjBXxb4
=SOH4
-----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