
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Dan Searles Sent: Monday, July 30, 2012 3:54 PM To: boost@lists.boost.org Subject: [boost] [rational] with optional over/underflow checking
Would there be any interest in a modified "rational" class template/header that optionally allows for an exception be generated if there is under/overflow during any of the operations? I have been developing such a template, where the new defaulted bool template parameter would generate the class exactly as before to preserve the original stable implementation, and to support unlimited-precision integer where over/underflow would not be possible. Setting the new template parameter to true, however would generate code that adds the over/underflow checking.
This must be useful, but must mesh with Multiprecision (provided Multiprecision is accepted). I'm sure John Maddock will have some views on this (if he isn't already plotting something ;-).
I have also generated new test driver code (BTW test code referenced by the documentation does not appear to exist, or at least the link is broken).
rational.hpp has been around and stable for quite some time, so there may be a desire to keep it unchanged, but its original function (and indeed its original source code) can be maintained
\boost-trunk\libs\rational\test\rational_test.cpp is being run by the testers. http://www.boost.org/development/tests/trunk/developer/rational.html You might like to attach your new test code? through the
template system.
Stability is useful, but like all software it needs maintenance, and this is yet another example of original authors now not being traceable. Several libraries need a new maintainer but currently we are dithering about the best process for this. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com