|
Boost : |
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-10-28 13:24:40
helmut.zeisel_at_[hidden] wrote:
> template<class Int, class Float> void
> rational_approximation_farey(boost::rational<Int>& r,
> const Float& v,
> const Float& error);
I don't like this. We should have a value-returning function,
and the user may well specify the "Int" explicitly when calling
the function:
rational<Int> r = rational_approximation_farey<Int>(3.1.4159, 0.01);
for your preferred variant of Int, e.g. Int = big_int.
(Note that the argument that this doesn't work with MSVC does not really
convince me, because we chose not to integrate the float approximation
into the rational header, so there is no degradation of portability
for rational.hpp.)
> I do not know, however, whether these
> two different interfaces might be too confusing to the user.
I think they are confusing.
Jens Maurer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk