
In MPFI documentation it is said that "MPFI functions operate on valid intervals ..., their behavior with non-valid intervals as input is undefined". Are intervals checked in Boost Multiprecision library whether they are invalid? Can this be easily done using Boost? Kind regards, Petr.
No, the class is a very thin wrapper around mpfi so there's practically no error checking. I really should add some error checks to the functions that create new intervals (i.e. assignment operators from two "components"): I'll do that shortly. You can check intervals yourself by accessing the individual components, for example with: assert(lower(my_interval) <= upper(my_interval)); You can also get the underlying mpfi_t via: my_interval.backend().data(); Checking for infinities/NaN's etc can be done with the usual isinf, isnan, isfinite, fpclassify etc. These rely on mpfi's functions internally, I'm not sure what happens to these if you've managed to create an invalid interval somehow - will check. HTH, John.