|
Boost : |
Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-04-02 14:33:42
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/02/2010 02:07 PM, Scott McMurray wrote:
> I think is_nan(Inf) should be false, but is_finite(Inf) should also
> be false.
Since it won't be representable by the finite_xint that you proposed, it
would have to.
>> If I don't add an infinity value, I could. I'm leaning toward adding one
>> (with sign), but it will act exactly like a NaN except for comparisons.
>>
> Actually, you *can* calculate with infinity. That's the reason for
> having it separate from NaN, and why it needs a sign. [...]
Hm, point taken. I was only planning to make it work for comparisons,
since the only reason proposed for it was for boundary markers, but that
works too.
> But the indeterminate forms do, of course, give NaNs: [...]
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?
> Hopefully that'll make you lean further :P
:-) I'm not sure how useful the operations on infinities would be, but
it looks like it would be easy enough to add them.
- --
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/
iEYEARECAAYFAku2OIIACgkQp9x9jeZ9/wTahACgwTmqzynd1JtQlFayU6cnWZ6U
rU4AoN2S381U5lJtz9kXkKUxhFDoyGPn
=MGNu
-----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