|
Boost Users : |
Subject: [Boost-users] [math] iround / llround with rounding error
From: gast128 (gast128_at_[hidden])
Date: 2010-12-13 06:12:43
Hello all,
we want to use iround / llround without exception handling. This is possible
with the 'user_error' option and override a 'user_rounding_error' function.
We want to return numeric_limits<int>::max() or numeric_limits<__int64>::max()
if the rounding overflows over the maximum integer domain. This is then
problematic since the 'user_rounding_error' has a template argument only for
its source type (e.g. float / double), but not for its target type (i.e. int /
__int64).
We can ofc do the check before calling iround / llround, but this check would
then executed be twice for the normal non overflow case.
Anyone idea?
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