Le mercredi 16 février 2005 à 15:50 -0500, Robert Ferguson a écrit :
Dear list,
I hope I am writing to the correct place, and that this isn't a frequently asked question.. but I'd like to know a little about comparisons and the Interval library.
[...]
I'd like to use the boost::logic::tribool to identify the semi-frequent indeterminant case.
You are right in expecting such an implementation. Mapping interval comparisons to tribool is natural enough to warrant it.
When I do this and the indeterminate case happens, an exception triggers and the function quits. This could be an error on my behalf, but it seems like this the default behavior.
Yes, the default behavior is to mimic the behavior of the real comparison. And since there is no such thing as an indeterminate case in the real comparison, an exception is thrown.
Its not that I can't do the try, catch, its just a matter of style. Can I have my cake and eat it too?
You can. You just have to ask for another comparison operator.
Long version:
- libs/numeric/interval/examples/tribool.cpp
- libs/numeric/interval/doc/comparisons.htm
Short version:
- #include