From 6d525adeb65c5300bd748017459252a3f4576392 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 5 Feb 2013 11:02:44 -0500 Subject: Use correct version of rint() --- floatprops.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'floatprops.h') diff --git a/floatprops.h b/floatprops.h index 4608b10..c58dfdd 100644 --- a/floatprops.h +++ b/floatprops.h @@ -86,9 +86,9 @@ namespace vecmathlib { static inline real_t convert_float(int_t x) { return real_t(x); } static inline int_t convert_int(real_t x) { - static_assert(sizeof(std::rint(x)) == sizeof(int_t), - "rint() has wrong return type"); - return std::rint(x); + static_assert(sizeof std::lrint(x) >= sizeof(int_t), + "lrint() has wrong return type"); + return std::lrint(x); } }; @@ -155,9 +155,9 @@ namespace vecmathlib { static inline real_t convert_float(int_t x) { return real_t(x); } static inline int_t convert_int(real_t x) { - static_assert(sizeof(std::llrint(x)) == sizeof(int_t), - "llrint() has wrong return type"); - return std::llrint(x); + static_assert(sizeof std::lrint(x) >= sizeof(int_t), + "lrint() has wrong return type"); + return std::lrint(x); } }; -- cgit v1.1