|
Boost : |
Subject: Re: [boost] [rational] with optional over/underflow checking
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2012-07-31 10:14:07
> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Dan
Searles
> Sent: Monday, July 30, 2012 3:54 PM
> To: boost_at_[hidden]
> 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).
\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?
> 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
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_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk