diff --git a/include/ck/utility/mxfp_utils.hpp b/include/ck/utility/mxfp_utils.hpp index cf7a3e8713..ebed85f5fd 100644 --- a/include/ck/utility/mxfp_utils.hpp +++ b/include/ck/utility/mxfp_utils.hpp @@ -213,7 +213,7 @@ __host__ __device__ inline T convert_to_type(float value) { // closer to 0 if(std::abs(value) <= std::abs(min_subnorm - value)) - return 0; + return sign << (NumericUtils::exp + NumericUtils::mant); else return 1 | (sign << (NumericUtils::exp + NumericUtils::mant)); } @@ -249,7 +249,7 @@ __host__ __device__ inline T convert_to_type(float value) if(out_exponent == 0 && mantissa == 0) { - return 0; + return sign << (NumericUtils::exp + NumericUtils::mant); } mantissa &= (1UL << NumericUtils::mant) - 1;