Boost logo

Boost :

From: Gabriel Dos Reis (Gabriel.Dos-Reis_at_[hidden])
Date: 2000-03-08 19:15:36


Jens Maurer <jmaurer_at_[hidden]> writes:

| jsiek_at_[hidden] wrote:
| > Jens Maurer writes:
| > > [divide by zero]
| > >
| > > This currently gives [-inf, inf] with my class.
| >
| > From what my chemisty friend's have told me, this is what they usually
| > want, but there may be situations where a thrown exception is
| > better. Perhaps this could be parameterizable?
|
| It is. Roll your own interval_traits<>::infinity() if
| you want exceptions. We may want to tighten the specs
| so that interval_traits::infinity() and ...::nan()
| are always called if the arguments produce that result,
| so that we are independent on the (implementation-defined)
| behaviour of the underlying "double" or whatever.

Well, LIA-II strongly recommands use of exceptions to report failure.
For LIA-III, there is plan to add interval-arithmetic and it is likely
division by zero will end up with a thrown exception, as is the case
in LIA-II. Note however that division by 0.0 does not result in
thrown exception.

-- Gaby


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