|
Boost Users : |
Subject: Re: [Boost-users] [math] round to fraction
From: gast128 (gast128_at_[hidden])
Date: 2010-10-27 06:23:49
John Maddock <boost.regex <at> virgin.net> writes:
> Probably overkill to add to Boost.Math, but how about:
>
> template <class T>
> T round2fraction(T x, T f)
> {
> return f * round(x/f);
> }
Thx, this is at least shorter than our solution.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net