Boost logo

Boost :

Subject: Re: [boost] New Boost.XInt Library, request preliminary review
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2010-03-28 17:47:06

Hash: SHA1

On 03/28/2010 04:45 PM, Scott McMurray wrote:

> +Infinity represents the concept of something larger than any specific
> value you can state, and -Infinity something smaller.
> So while you could choose to just use NaN in place of the infinities,
> there are situations in which infinity is reasonable where NaN is not.


> Imagine a container of intervals, for example -- there, +/- infinity
> would be very useful for the two outermost endpoints. And something
> like atan(Infinity) can reasonably give \pi/2, whereas atan(NaN) can
> only give NaN.

No argument. But in the context of an integer library that will exactly
represent any value that it can find the memory for, and will throw an
exception if it can't get the memory it needs to represent a number
exactly, I can't see much need for a specific value to represent infinity.

In the case of boundaries provided to a function, the NaN value would
represent the same idea as an infinity value -- that there is no
specified boundary in that direction.

If you can suggest a case where a separate infinity value would be
necessary, I'll certainly add it.
- --
Chad Nelson
Oak Circle Software, Inc.
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


Boost list run by bdawes at, gregod at, cpdaniel at, john at