@@ -349,7 +349,7 @@ namespace half_float
349
349
struct binary_t {};
350
350
351
351
// / Tag for binary construction.
352
- HALF_CONSTEXPR_CONST binary_t binary = binary_t ();
352
+ static HALF_CONSTEXPR_CONST binary_t binary = binary_t ();
353
353
354
354
// / Temporary half-precision expression.
355
355
// / This class represents a half-precision expression which just stores a single-precision value internally.
@@ -1172,7 +1172,8 @@ namespace half_float
1172
1172
// / Constructor.
1173
1173
// / \param bits binary representation to set half to
1174
1174
CAFFE_UTIL_HD
1175
- HALF_CONSTEXPR half (detail::binary_t , detail::uint16 bits) : data_(bits) {}
1175
+ HALF_CONSTEXPR half (detail::binary_t , unsigned int bits) HALF_NOEXCEPT
1176
+ : data_(static_cast <detail::uint16>(bits)) {}
1176
1177
1177
1178
// / Internal binary representation
1178
1179
detail::uint16 data_;
@@ -3067,32 +3068,32 @@ namespace std
3067
3068
static HALF_CONSTEXPR_CONST int max_exponent10 = 4 ;
3068
3069
3069
3070
// / Smallest positive normal value.
3070
- static HALF_CONSTEXPR half_float::half min () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x0400 ) ; }
3071
+ static HALF_CONSTEXPR half_float::half min () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x0400 } ; }
3071
3072
3072
3073
// / Smallest finite value.
3073
- static HALF_CONSTEXPR half_float::half lowest () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0xFBFF ) ; }
3074
+ static HALF_CONSTEXPR half_float::half lowest () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0xFBFF } ; }
3074
3075
3075
3076
// / Largest finite value.
3076
- static HALF_CONSTEXPR half_float::half max () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7BFF ) ; }
3077
+ static HALF_CONSTEXPR half_float::half max () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7BFF } ; }
3077
3078
3078
3079
// / Difference between one and next representable value.
3079
- static HALF_CONSTEXPR half_float::half epsilon () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x1400 ) ; }
3080
+ static HALF_CONSTEXPR half_float::half epsilon () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x1400 } ; }
3080
3081
3081
3082
// / Maximum rounding error.
3082
3083
static HALF_CONSTEXPR half_float::half round_error () HALF_NOTHROW
3083
- { return half_float::half ( half_float::detail::binary, (round_style==std::round_to_nearest) ? 0x3800 : 0x3C00 ) ; }
3084
+ { return half_float::half{ half_float::detail::binary, (round_style==std::round_to_nearest) ? 0x3800 : 0x3C00 } ; }
3084
3085
3085
3086
// / Positive infinity.
3086
- static HALF_CONSTEXPR half_float::half infinity () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7C00 ) ; }
3087
+ static HALF_CONSTEXPR half_float::half infinity () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7C00 } ; }
3087
3088
3088
3089
// / Quiet NaN.
3089
- static HALF_CONSTEXPR half_float::half quiet_NaN () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7FFF ) ; }
3090
+ static HALF_CONSTEXPR half_float::half quiet_NaN () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7FFF } ; }
3090
3091
3091
3092
// / Signalling NaN.
3092
- static HALF_CONSTEXPR half_float::half signaling_NaN () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7DFF ) ; }
3093
+ static HALF_CONSTEXPR half_float::half signaling_NaN () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7DFF } ; }
3093
3094
3094
3095
// / Smallest positive subnormal value.
3095
- static HALF_CONSTEXPR half_float::half denorm_min () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x0001 ) ; }
3096
+ static HALF_CONSTEXPR half_float::half denorm_min () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x0001 } ; }
3096
3097
};
3097
3098
3098
3099
0 commit comments