Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 2000-03-14 12:22:41


Jens Maurer wrote:
>
> jsiek_at_[hidden] wrote:
> > Looking at the interval proposal there's some missing functionality.
>
> I've added some of the missing functionality.
>
> > Also it includes the assembly code
> > for Solaris rounding modes.
>
> Since it is for non-commercial use only, it is incompatible with boost
> copyright rules.
>
> > There are some issues that need carefull attention, the behaviour of
> > divide by zero,
>
> This currently gives [-inf, inf] with my class.

(assuming 0 means exact 0)

This doesn't seem correct to me. Dividing by a very small value should
cause overflow (infinity of the sign of the product). Dividing by 0
makes no sens.

With fp numbers, 0. may means very small. Interval is expected to be
exact: [0, 0] means 0.

Two behaviours are possible:
- throw an exception
- x/0 returns { r | r*0 \in x } (the empty interval if x doesn't contain
  0, [-inf, inf] otherwise)

BTW, I saw something funny in the doc
(at http://www.egroups.com/docvault/boost/interval/interval.html):

interval multiplicative_inverse(const interval&)

Returns: 1/*this

-- 
Valentin Bonnard

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