summaryrefslogtreecommitdiffstats
path: root/floatprops.h
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-02-05 11:02:44 -0500
committerErik Schnetter <schnetter@gmail.com>2013-02-05 11:02:44 -0500
commit6d525adeb65c5300bd748017459252a3f4576392 (patch)
tree184319d94388c725028d1362fc114eddb6efd16d /floatprops.h
parent8e34821f26f3d9faeb9e0263b59ac3aa5b67d08b (diff)
downloadvecmathlib-6d525adeb65c5300bd748017459252a3f4576392.zip
vecmathlib-6d525adeb65c5300bd748017459252a3f4576392.tar.gz
Use correct version of rint()
Diffstat (limited to 'floatprops.h')
-rw-r--r--floatprops.h12
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);
}
};
OpenPOWER on IntegriCloud