23 Apr
2008
23 Apr
'08
5:20 p.m.
Rainer Thaden wrote:
If you're happy to use SVN Trunk, then you might want to take a look at the trunc and round family of functions here: http://svn.boost.org/svn/boost/trunk/libs/math/doc/sf_and_dist/html/math_too...
Thanks John. From your answer I read that it doesn't seem to be possible to tell numeric_cast to return the nearest integer, right?
That I don't know, but you'd have to customise it for sure, where as these dedicated rounding functions are intended to do just what they say out of the box :-)
So I'd have to round the floating point type to the nearest integer with iround and catch rounding errors instead of the exceptions numeric_cast throws?
Yep. John.