@@ -210,115 +210,115 @@ constexpr static float powers_of_ten_float[] = {1e0, 1e1, 1e2, 1e3, 1e4, 1e5,
210210 1e6 , 1e7 , 1e8 , 1e9 , 1e10 };
211211
212212template <typename T> struct binary_format {
213- static constexpr int mantissa_explicit_bits ();
214- static constexpr int minimum_exponent ();
215- static constexpr int infinite_power ();
216- static constexpr int sign_index ();
217- static constexpr int min_exponent_fast_path ();
218- static constexpr int max_exponent_fast_path ();
219- static constexpr int max_exponent_round_to_even ();
220- static constexpr int min_exponent_round_to_even ();
221- static constexpr uint64_t max_mantissa_fast_path ();
222- static constexpr int largest_power_of_ten ();
223- static constexpr int smallest_power_of_ten ();
224- static constexpr T exact_power_of_ten (int64_t power);
213+ static inline constexpr int mantissa_explicit_bits ();
214+ static inline constexpr int minimum_exponent ();
215+ static inline constexpr int infinite_power ();
216+ static inline constexpr int sign_index ();
217+ static inline constexpr int min_exponent_fast_path ();
218+ static inline constexpr int max_exponent_fast_path ();
219+ static inline constexpr int max_exponent_round_to_even ();
220+ static inline constexpr int min_exponent_round_to_even ();
221+ static inline constexpr uint64_t max_mantissa_fast_path ();
222+ static inline constexpr int largest_power_of_ten ();
223+ static inline constexpr int smallest_power_of_ten ();
224+ static inline constexpr T exact_power_of_ten (int64_t power);
225225};
226226
227- template <> constexpr int binary_format<double >::mantissa_explicit_bits() {
227+ template <> inline constexpr int binary_format<double >::mantissa_explicit_bits() {
228228 return 52 ;
229229}
230- template <> constexpr int binary_format<float >::mantissa_explicit_bits() {
230+ template <> inline constexpr int binary_format<float >::mantissa_explicit_bits() {
231231 return 23 ;
232232}
233233
234- template <> constexpr int binary_format<double >::max_exponent_round_to_even() {
234+ template <> inline constexpr int binary_format<double >::max_exponent_round_to_even() {
235235 return 23 ;
236236}
237237
238- template <> constexpr int binary_format<float >::max_exponent_round_to_even() {
238+ template <> inline constexpr int binary_format<float >::max_exponent_round_to_even() {
239239 return 10 ;
240240}
241241
242- template <> constexpr int binary_format<double >::min_exponent_round_to_even() {
242+ template <> inline constexpr int binary_format<double >::min_exponent_round_to_even() {
243243 return -4 ;
244244}
245245
246- template <> constexpr int binary_format<float >::min_exponent_round_to_even() {
246+ template <> inline constexpr int binary_format<float >::min_exponent_round_to_even() {
247247 return -17 ;
248248}
249249
250- template <> constexpr int binary_format<double >::minimum_exponent() {
250+ template <> inline constexpr int binary_format<double >::minimum_exponent() {
251251 return -1023 ;
252252}
253- template <> constexpr int binary_format<float >::minimum_exponent() {
253+ template <> inline constexpr int binary_format<float >::minimum_exponent() {
254254 return -127 ;
255255}
256256
257- template <> constexpr int binary_format<double >::infinite_power() {
257+ template <> inline constexpr int binary_format<double >::infinite_power() {
258258 return 0x7FF ;
259259}
260- template <> constexpr int binary_format<float >::infinite_power() {
260+ template <> inline constexpr int binary_format<float >::infinite_power() {
261261 return 0xFF ;
262262}
263263
264- template <> constexpr int binary_format<double >::sign_index() { return 63 ; }
265- template <> constexpr int binary_format<float >::sign_index() { return 31 ; }
264+ template <> inline constexpr int binary_format<double >::sign_index() { return 63 ; }
265+ template <> inline constexpr int binary_format<float >::sign_index() { return 31 ; }
266266
267- template <> constexpr int binary_format<double >::min_exponent_fast_path() {
267+ template <> inline constexpr int binary_format<double >::min_exponent_fast_path() {
268268#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
269269 return 0 ;
270270#else
271271 return -22 ;
272272#endif
273273}
274- template <> constexpr int binary_format<float >::min_exponent_fast_path() {
274+ template <> inline constexpr int binary_format<float >::min_exponent_fast_path() {
275275#if (FLT_EVAL_METHOD != 1) && (FLT_EVAL_METHOD != 0)
276276 return 0 ;
277277#else
278278 return -10 ;
279279#endif
280280}
281281
282- template <> constexpr int binary_format<double >::max_exponent_fast_path() {
282+ template <> inline constexpr int binary_format<double >::max_exponent_fast_path() {
283283 return 22 ;
284284}
285- template <> constexpr int binary_format<float >::max_exponent_fast_path() {
285+ template <> inline constexpr int binary_format<float >::max_exponent_fast_path() {
286286 return 10 ;
287287}
288288
289- template <> constexpr uint64_t binary_format<double >::max_mantissa_fast_path() {
289+ template <> inline constexpr uint64_t binary_format<double >::max_mantissa_fast_path() {
290290 return uint64_t (2 ) << mantissa_explicit_bits ();
291291}
292- template <> constexpr uint64_t binary_format<float >::max_mantissa_fast_path() {
292+ template <> inline constexpr uint64_t binary_format<float >::max_mantissa_fast_path() {
293293 return uint64_t (2 ) << mantissa_explicit_bits ();
294294}
295295
296296template <>
297- constexpr double binary_format<double >::exact_power_of_ten(int64_t power) {
297+ inline constexpr double binary_format<double >::exact_power_of_ten(int64_t power) {
298298 return powers_of_ten_double[power];
299299}
300300template <>
301- constexpr float binary_format<float >::exact_power_of_ten(int64_t power) {
301+ inline constexpr float binary_format<float >::exact_power_of_ten(int64_t power) {
302302
303303 return powers_of_ten_float[power];
304304}
305305
306306
307307template <>
308- constexpr int binary_format<double >::largest_power_of_ten() {
308+ inline constexpr int binary_format<double >::largest_power_of_ten() {
309309 return 308 ;
310310}
311311template <>
312- constexpr int binary_format<float >::largest_power_of_ten() {
312+ inline constexpr int binary_format<float >::largest_power_of_ten() {
313313 return 38 ;
314314}
315315
316316template <>
317- constexpr int binary_format<double >::smallest_power_of_ten() {
317+ inline constexpr int binary_format<double >::smallest_power_of_ten() {
318318 return -342 ;
319319}
320320template <>
321- constexpr int binary_format<float >::smallest_power_of_ten() {
321+ inline constexpr int binary_format<float >::smallest_power_of_ten() {
322322 return -65 ;
323323}
324324
0 commit comments