diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-02-05 11:02:44 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-02-05 11:02:44 -0500 |
commit | 6d525adeb65c5300bd748017459252a3f4576392 (patch) | |
tree | 184319d94388c725028d1362fc114eddb6efd16d /floatprops.h | |
parent | 8e34821f26f3d9faeb9e0263b59ac3aa5b67d08b (diff) | |
download | vecmathlib-6d525adeb65c5300bd748017459252a3f4576392.zip vecmathlib-6d525adeb65c5300bd748017459252a3f4576392.tar.gz |
Use correct version of rint()
Diffstat (limited to 'floatprops.h')
-rw-r--r-- | floatprops.h | 12 |
1 files changed, 6 insertions, 6 deletions
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); } }; |