Boost logo

Boost :

Subject: Re: [boost] boost interval arithmetic
From: Marc Glisse (marc.glisse_at_[hidden])
Date: 2015-01-15 12:14:07

On Thu, 15 Jan 2015, Asbjørn wrote:

> On 15.01.2015 15:01, Павел Кудан wrote:
>> Now see:
>> [-1.0, 1.0] / .0
>> What is the correct result? Of course, [-inf, inf]
> The way I understand interval arithmetics, the result is the set
> {x / 0 for all x in [-1, 1]}.
> Now, x/0 is undefined for all x in [-1, 1], so returning an empty set seems
> logical to me.

For IEEE double, 1./0 is well defined as +inf, and -1./0 as -inf, so I
agree that returning an empty set (apparently creating an empty set
throws, with the default policy) is questionable, it depends on your
application whether you want empty or [-inf,+inf]. I did not check if
boost provides a policy to change that behavior.

Marc Glisse

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