Commit 345aadbf authored by Dominik Charousset's avatar Dominik Charousset

Fix "double promotion" warning

parent bd2452c9
...@@ -68,7 +68,9 @@ typename ieee_754_trait<T>::packed_type pack754(T f) { ...@@ -68,7 +68,9 @@ typename ieee_754_trait<T>::packed_type pack754(T f) {
typedef ieee_754_trait<T> trait; // using trait = ... fails on GCC 4.7 typedef ieee_754_trait<T> trait; // using trait = ... fails on GCC 4.7
using result_type = typename trait::packed_type; using result_type = typename trait::packed_type;
// filter special type // filter special type
if (fabs(f) <= trait::zero) return 0; // only true if f equals +0 or -0 if (std::fabs(f) <= trait::zero) {
return 0; // only true if f equals +0 or -0
}
auto significandbits = trait::bits - trait::expbits - 1; // -1 for sign bit auto significandbits = trait::bits - trait::expbits - 1; // -1 for sign bit
// check sign and begin normalization // check sign and begin normalization
result_type sign; result_type sign;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment