diff options
Diffstat (limited to 'mathfuncs_convert.h')
-rw-r--r-- | mathfuncs_convert.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mathfuncs_convert.h b/mathfuncs_convert.h index 70aedc2..79befbc 100644 --- a/mathfuncs_convert.h +++ b/mathfuncs_convert.h @@ -121,6 +121,14 @@ namespace vecmathlib { return ifthen(x<RV(0.0), vml_antitrunc(x), trunc(x)); } + // Round to nearest integer, breaking ties using prevailing rounding + // mode (default: round to even), returning an integer + template<typename realvec_t> + typename realvec_t::intvec_t mathfuncs<realvec_t>::vml_lrint(realvec_t x) + { + return convert_int(rint(x)); + } + // Round to nearest integer, breaking ties away from zero template<typename realvec_t> realvec_t mathfuncs<realvec_t>::vml_round(realvec_t x) |