31#ifndef ETL_LIMITS_INCLUDED
32#define ETL_LIMITS_INCLUDED
38#if ETL_NOT_USING_STL && defined(ETL_COMPILER_ARM5) && !defined(__USE_C99_MATH)
40 #define __USE_C99_MATH
50#if defined(ETL_COMPILER_MICROSOFT)
52 #pragma warning(disable : 26812)
56 #define ETL_LOG10_OF_2(x) (((x) * 301) / 1000)
58 #if !defined(LDBL_MIN) && defined(DBL_MIN)
61 #define LDBL_MIN DBL_MIN
62 #define LDBL_MAX DBL_MAX
63 #define LDBL_EPSILON DBL_EPSILON
64 #define LDBL_MANT_DIG DBL_MANT_DIG
65 #define LDBL_DIG DBL_DIG
66 #define LDBL_MIN_EXP DBL_MIN_EXP
67 #define LDBL_MIN_10_EXP DBL_MIN_10_EXP
68 #define LDBL_MAX_EXP DBL_MAX_EXP
69 #define LDBL_MAX_10_EXP DBL_MAX_10_EXP
72 #if !defined(HUGE_VAL)
76 #define HUGE_VALF FLT_MAX
77 #define HUGE_VAL DBL_MAX
78 #define HUGE_VALL LDBL_MAX
81 #if defined(ETL_NO_CPP_NAN_SUPPORT)
85 #define ETL_NAN static_cast<double>(NAN)
86 #define ETL_NANL static_cast<long double>(NAN)
87 #define ETL_HAS_NAN true
91 #define ETL_NANF HUGE_VALF
92 #define ETL_NAN HUGE_VAL
93 #define ETL_NANL HUGE_VALL
94 #define ETL_HAS_NAN false
98 #define ETL_NANF nanf("")
99 #define ETL_NAN nan("")
100 #define ETL_NANL nanl("")
101 #define ETL_HAS_NAN true
106 enum float_round_style
108 round_indeterminate = -1,
109 round_toward_zero = 0,
110 round_to_nearest = 1,
111 round_toward_infinity = 2,
112 round_toward_neg_infinity = 3,
115 enum float_denorm_style
117 denorm_indeterminate = -1,
122 namespace private_limits
126 template <
typename T =
void>
127 class integral_limits_common
131 static ETL_CONSTANT
bool is_specialized =
true;
132 static ETL_CONSTANT
bool is_integer =
true;
133 static ETL_CONSTANT
bool is_exact =
true;
134 static ETL_CONSTANT
int max_digits10 = 0;
135 static ETL_CONSTANT
int radix = 2;
136 static ETL_CONSTANT
int min_exponent = 0;
137 static ETL_CONSTANT
int min_exponent10 = 0;
138 static ETL_CONSTANT
int max_exponent = 0;
139 static ETL_CONSTANT
int max_exponent10 = 0;
140 static ETL_CONSTANT
bool has_infinity =
false;
141 static ETL_CONSTANT
bool has_quiet_NaN =
false;
142 static ETL_CONSTANT
bool has_signaling_NaN =
false;
143 static ETL_CONSTANT
bool has_denorm_loss =
false;
144 static ETL_CONSTANT
bool is_iec559 =
false;
145 static ETL_CONSTANT
bool is_bounded =
true;
146 static ETL_CONSTANT
bool traps =
false;
147 static ETL_CONSTANT
bool tinyness_before =
false;
148 static ETL_CONSTANT float_denorm_style has_denorm = denorm_absent;
149 static ETL_CONSTANT float_round_style round_style = round_toward_zero;
152 template <
typename T>
153 ETL_CONSTANT
bool integral_limits_common<T>::is_specialized;
155 template <
typename T>
156 ETL_CONSTANT
bool integral_limits_common<T>::is_integer;
158 template <
typename T>
159 ETL_CONSTANT
bool integral_limits_common<T>::is_exact;
161 template <
typename T>
162 ETL_CONSTANT
int integral_limits_common<T>::max_digits10;
164 template <
typename T>
165 ETL_CONSTANT
int integral_limits_common<T>::radix;
167 template <
typename T>
168 ETL_CONSTANT
int integral_limits_common<T>::min_exponent;
170 template <
typename T>
171 ETL_CONSTANT
int integral_limits_common<T>::min_exponent10;
173 template <
typename T>
174 ETL_CONSTANT
int integral_limits_common<T>::max_exponent;
176 template <
typename T>
177 ETL_CONSTANT
int integral_limits_common<T>::max_exponent10;
179 template <
typename T>
180 ETL_CONSTANT
bool integral_limits_common<T>::has_infinity;
182 template <
typename T>
183 ETL_CONSTANT
bool integral_limits_common<T>::has_quiet_NaN;
185 template <
typename T>
186 ETL_CONSTANT
bool integral_limits_common<T>::has_signaling_NaN;
188 template <
typename T>
189 ETL_CONSTANT
bool integral_limits_common<T>::has_denorm_loss;
191 template <
typename T>
192 ETL_CONSTANT
bool integral_limits_common<T>::is_iec559;
194 template <
typename T>
195 ETL_CONSTANT
bool integral_limits_common<T>::is_bounded;
197 template <
typename T>
198 ETL_CONSTANT
bool integral_limits_common<T>::traps;
200 template <
typename T>
201 ETL_CONSTANT
bool integral_limits_common<T>::tinyness_before;
203 template <
typename T>
204 ETL_CONSTANT float_denorm_style integral_limits_common<T>::has_denorm;
206 template <
typename T>
207 ETL_CONSTANT float_round_style integral_limits_common<T>::round_style;
211 template <
typename T =
void>
212 struct integral_limits_bool
214 static ETL_CONSTANT
int digits = 1;
215 static ETL_CONSTANT
int digits10 = 0;
216 static ETL_CONSTANT
bool is_signed =
false;
217 static ETL_CONSTANT
bool is_modulo =
false;
220 template <
typename T>
221 ETL_CONSTANT
int integral_limits_bool<T>::digits;
223 template <
typename T>
224 ETL_CONSTANT
int integral_limits_bool<T>::digits10;
226 template <
typename T>
227 ETL_CONSTANT
bool integral_limits_bool<T>::is_signed;
229 template <
typename T>
230 ETL_CONSTANT
bool integral_limits_bool<T>::is_modulo;
234 template <
typename T =
void>
235 struct integral_limits_char
237 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(char)) - (etl::is_signed<char>::value ? 1 : 0);
238 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
239 static ETL_CONSTANT
bool is_signed = etl::is_signed<char>::value;
240 static ETL_CONSTANT
bool is_modulo = etl::is_unsigned<char>::value;
243 template <
typename T>
244 ETL_CONSTANT
int integral_limits_char<T>::digits;
246 template <
typename T>
247 ETL_CONSTANT
int integral_limits_char<T>::digits10;
249 template <
typename T>
250 ETL_CONSTANT
bool integral_limits_char<T>::is_signed;
252 template <
typename T>
253 ETL_CONSTANT
bool integral_limits_char<T>::is_modulo;
257 template <
typename T =
void>
258 struct integral_limits_unsigned_char
260 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(
unsigned char));
261 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
262 static ETL_CONSTANT
bool is_signed =
false;
263 static ETL_CONSTANT
bool is_modulo =
true;
266 template <
typename T>
267 ETL_CONSTANT
int integral_limits_unsigned_char<T>::digits;
269 template <
typename T>
270 ETL_CONSTANT
int integral_limits_unsigned_char<T>::digits10;
272 template <
typename T>
273 ETL_CONSTANT
bool integral_limits_unsigned_char<T>::is_signed;
275 template <
typename T>
276 ETL_CONSTANT
bool integral_limits_unsigned_char<T>::is_modulo;
280 template <
typename T =
void>
281 struct integral_limits_signed_char
283 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(char)) - 1;
284 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
285 static ETL_CONSTANT
bool is_signed =
true;
286 static ETL_CONSTANT
bool is_modulo =
false;
289 template <
typename T>
290 ETL_CONSTANT
int integral_limits_signed_char<T>::digits;
292 template <
typename T>
293 ETL_CONSTANT
int integral_limits_signed_char<T>::digits10;
295 template <
typename T>
296 ETL_CONSTANT
bool integral_limits_signed_char<T>::is_signed;
298 template <
typename T>
299 ETL_CONSTANT
bool integral_limits_signed_char<T>::is_modulo;
301 #if ETL_HAS_NATIVE_CHAR8_T
304 template <
typename T =
void>
305 struct integral_limits_char8_t
307 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(char8_t)) - (etl::is_signed<char8_t>::value ? 1 : 0);
308 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
309 static ETL_CONSTANT
bool is_signed = etl::is_signed<char8_t>::value;
310 static ETL_CONSTANT
bool is_modulo =
false;
313 template <
typename T>
314 ETL_CONSTANT
int integral_limits_char8_t<T>::digits;
316 template <
typename T>
317 ETL_CONSTANT
int integral_limits_char8_t<T>::digits10;
319 template <
typename T>
320 ETL_CONSTANT
bool integral_limits_char8_t<T>::is_signed;
322 template <
typename T>
323 ETL_CONSTANT
bool integral_limits_char8_t<T>::is_modulo;
326 #if ETL_HAS_NATIVE_CHAR16_T
329 template <
typename T =
void>
330 struct integral_limits_char16_t
332 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(char16_t));
333 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
334 static ETL_CONSTANT
bool is_signed =
false;
335 static ETL_CONSTANT
bool is_modulo =
true;
338 template <
typename T>
339 ETL_CONSTANT
int integral_limits_char16_t<T>::digits;
341 template <
typename T>
342 ETL_CONSTANT
int integral_limits_char16_t<T>::digits10;
344 template <
typename T>
345 ETL_CONSTANT
bool integral_limits_char16_t<T>::is_signed;
347 template <
typename T>
348 ETL_CONSTANT
bool integral_limits_char16_t<T>::is_modulo;
351 #if ETL_HAS_NATIVE_CHAR32_T
354 template <
typename T =
void>
355 struct integral_limits_char32_t
357 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(char32_t));
358 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
359 static ETL_CONSTANT
bool is_signed =
false;
360 static ETL_CONSTANT
bool is_modulo =
true;
363 template <
typename T>
364 ETL_CONSTANT
int integral_limits_char32_t<T>::digits;
366 template <
typename T>
367 ETL_CONSTANT
int integral_limits_char32_t<T>::digits10;
369 template <
typename T>
370 ETL_CONSTANT
bool integral_limits_char32_t<T>::is_signed;
372 template <
typename T>
373 ETL_CONSTANT
bool integral_limits_char32_t<T>::is_modulo;
378 template <
typename T =
void>
379 struct integral_limits_wchar_t
381 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(wchar_t)) - (etl::is_signed<wchar_t>::value ? 1 : 0);
382 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
383 static ETL_CONSTANT
bool is_signed = etl::is_signed<wchar_t>::value;
384 static ETL_CONSTANT
bool is_modulo = etl::is_unsigned<wchar_t>::value;
387 template <
typename T>
388 ETL_CONSTANT
int integral_limits_wchar_t<T>::digits;
390 template <
typename T>
391 ETL_CONSTANT
int integral_limits_wchar_t<T>::digits10;
393 template <
typename T>
394 ETL_CONSTANT
bool integral_limits_wchar_t<T>::is_signed;
396 template <
typename T>
397 ETL_CONSTANT
bool integral_limits_wchar_t<T>::is_modulo;
401 template <
typename T =
void>
402 struct integral_limits_short
404 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(short)) - 1;
405 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
406 static ETL_CONSTANT
bool is_signed =
true;
407 static ETL_CONSTANT
bool is_modulo =
false;
410 template <
typename T>
411 ETL_CONSTANT
int integral_limits_short<T>::digits;
413 template <
typename T>
414 ETL_CONSTANT
int integral_limits_short<T>::digits10;
416 template <
typename T>
417 ETL_CONSTANT
bool integral_limits_short<T>::is_signed;
419 template <
typename T>
420 ETL_CONSTANT
bool integral_limits_short<T>::is_modulo;
424 template <
typename T =
void>
425 struct integral_limits_unsigned_short
427 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(
unsigned short));
428 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
429 static ETL_CONSTANT
bool is_signed =
false;
430 static ETL_CONSTANT
bool is_modulo =
true;
433 template <
typename T>
434 ETL_CONSTANT
int integral_limits_unsigned_short<T>::digits;
436 template <
typename T>
437 ETL_CONSTANT
int integral_limits_unsigned_short<T>::digits10;
439 template <
typename T>
440 ETL_CONSTANT
bool integral_limits_unsigned_short<T>::is_signed;
442 template <
typename T>
443 ETL_CONSTANT
bool integral_limits_unsigned_short<T>::is_modulo;
447 template <
typename T =
void>
448 struct integral_limits_int
450 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(int)) - 1;
451 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
452 static ETL_CONSTANT
bool is_signed =
true;
453 static ETL_CONSTANT
bool is_modulo =
false;
456 template <
typename T>
457 ETL_CONSTANT
int integral_limits_int<T>::digits;
459 template <
typename T>
460 ETL_CONSTANT
int integral_limits_int<T>::digits10;
462 template <
typename T>
463 ETL_CONSTANT
bool integral_limits_int<T>::is_signed;
465 template <
typename T>
466 ETL_CONSTANT
bool integral_limits_int<T>::is_modulo;
470 template <
typename T =
void>
471 struct integral_limits_unsigned_int
473 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(
unsigned int));
474 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
475 static ETL_CONSTANT
bool is_signed =
false;
476 static ETL_CONSTANT
bool is_modulo =
true;
479 template <
typename T>
480 ETL_CONSTANT
int integral_limits_unsigned_int<T>::digits;
482 template <
typename T>
483 ETL_CONSTANT
int integral_limits_unsigned_int<T>::digits10;
485 template <
typename T>
486 ETL_CONSTANT
bool integral_limits_unsigned_int<T>::is_signed;
488 template <
typename T>
489 ETL_CONSTANT
bool integral_limits_unsigned_int<T>::is_modulo;
493 template <
typename T =
void>
494 struct integral_limits_long
496 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(long)) - 1;
497 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
498 static ETL_CONSTANT
bool is_signed =
true;
499 static ETL_CONSTANT
bool is_modulo =
false;
502 template <
typename T>
503 ETL_CONSTANT
int integral_limits_long<T>::digits;
505 template <
typename T>
506 ETL_CONSTANT
int integral_limits_long<T>::digits10;
508 template <
typename T>
509 ETL_CONSTANT
bool integral_limits_long<T>::is_signed;
511 template <
typename T>
512 ETL_CONSTANT
bool integral_limits_long<T>::is_modulo;
516 template <
typename T =
void>
517 struct integral_limits_unsigned_long
519 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(
unsigned long));
520 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
521 static ETL_CONSTANT
bool is_signed =
false;
522 static ETL_CONSTANT
bool is_modulo =
true;
525 template <
typename T>
526 ETL_CONSTANT
int integral_limits_unsigned_long<T>::digits;
528 template <
typename T>
529 ETL_CONSTANT
int integral_limits_unsigned_long<T>::digits10;
531 template <
typename T>
532 ETL_CONSTANT
bool integral_limits_unsigned_long<T>::is_signed;
534 template <
typename T>
535 ETL_CONSTANT
bool integral_limits_unsigned_long<T>::is_modulo;
539 template <
typename T =
void>
540 struct integral_limits_long_long
542 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(
long long)) - 1;
543 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
544 static ETL_CONSTANT
bool is_signed =
true;
545 static ETL_CONSTANT
bool is_modulo =
false;
548 template <
typename T>
549 ETL_CONSTANT
int integral_limits_long_long<T>::digits;
551 template <
typename T>
552 ETL_CONSTANT
int integral_limits_long_long<T>::digits10;
554 template <
typename T>
555 ETL_CONSTANT
bool integral_limits_long_long<T>::is_signed;
557 template <
typename T>
558 ETL_CONSTANT
bool integral_limits_long_long<T>::is_modulo;
562 template <
typename T =
void>
563 struct integral_limits_unsigned_long_long
565 static ETL_CONSTANT
int digits = (CHAR_BIT *
sizeof(
unsigned long long));
566 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
567 static ETL_CONSTANT
bool is_signed =
false;
568 static ETL_CONSTANT
bool is_modulo =
true;
571 template <
typename T>
572 ETL_CONSTANT
int integral_limits_unsigned_long_long<T>::digits;
574 template <
typename T>
575 ETL_CONSTANT
int integral_limits_unsigned_long_long<T>::digits10;
577 template <
typename T>
578 ETL_CONSTANT
bool integral_limits_unsigned_long_long<T>::is_signed;
580 template <
typename T>
581 ETL_CONSTANT
bool integral_limits_unsigned_long_long<T>::is_modulo;
585 template <
typename T =
void>
586 class floating_point_limits_common
590 static ETL_CONSTANT
bool is_specialized =
true;
591 static ETL_CONSTANT
bool is_signed =
true;
592 static ETL_CONSTANT
bool is_integer =
false;
593 static ETL_CONSTANT
bool is_exact =
false;
594 static ETL_CONSTANT
int radix = 2;
595 static ETL_CONSTANT
bool has_infinity =
true;
596 static ETL_CONSTANT
bool has_quiet_NaN = ETL_HAS_NAN;
597 static ETL_CONSTANT
bool has_signaling_NaN = ETL_HAS_NAN;
598 static ETL_CONSTANT
bool has_denorm_loss =
false;
599 static ETL_CONSTANT
bool is_iec559 =
false;
600 static ETL_CONSTANT
bool is_bounded =
true;
601 static ETL_CONSTANT
bool is_modulo =
false;
602 static ETL_CONSTANT
bool traps =
false;
603 static ETL_CONSTANT
bool tinyness_before =
false;
604 static ETL_CONSTANT float_denorm_style has_denorm = denorm_indeterminate;
605 static ETL_CONSTANT float_round_style round_style = round_indeterminate;
608 template <
typename T>
609 ETL_CONSTANT
bool floating_point_limits_common<T>::is_specialized;
611 template <
typename T>
612 ETL_CONSTANT
bool floating_point_limits_common<T>::is_signed;
614 template <
typename T>
615 ETL_CONSTANT
bool floating_point_limits_common<T>::is_integer;
617 template <
typename T>
618 ETL_CONSTANT
bool floating_point_limits_common<T>::is_exact;
620 template <
typename T>
621 ETL_CONSTANT
int floating_point_limits_common<T>::radix;
623 template <
typename T>
624 ETL_CONSTANT
bool floating_point_limits_common<T>::has_infinity;
626 template <
typename T>
627 ETL_CONSTANT
bool floating_point_limits_common<T>::has_quiet_NaN;
629 template <
typename T>
630 ETL_CONSTANT
bool floating_point_limits_common<T>::has_signaling_NaN;
632 template <
typename T>
633 ETL_CONSTANT
bool floating_point_limits_common<T>::has_denorm_loss;
635 template <
typename T>
636 ETL_CONSTANT
bool floating_point_limits_common<T>::is_iec559;
638 template <
typename T>
639 ETL_CONSTANT
bool floating_point_limits_common<T>::is_bounded;
641 template <
typename T>
642 ETL_CONSTANT
bool floating_point_limits_common<T>::is_modulo;
644 template <
typename T>
645 ETL_CONSTANT
bool floating_point_limits_common<T>::traps;
647 template <
typename T>
648 ETL_CONSTANT
bool floating_point_limits_common<T>::tinyness_before;
650 template <
typename T>
651 ETL_CONSTANT float_denorm_style floating_point_limits_common<T>::has_denorm;
653 template <
typename T>
654 ETL_CONSTANT float_round_style floating_point_limits_common<T>::round_style;
658 template <
typename T =
void>
659 struct floating_point_limits_float
661 static ETL_CONSTANT
int digits = FLT_MANT_DIG;
662 static ETL_CONSTANT
int digits10 = FLT_DIG;
663 static ETL_CONSTANT
int max_digits10 = ETL_LOG10_OF_2(FLT_MANT_DIG) + 2;
665 static ETL_CONSTANT
int min_exponent = FLT_MIN_EXP;
666 static ETL_CONSTANT
int min_exponent10 = FLT_MIN_10_EXP;
667 static ETL_CONSTANT
int max_exponent = FLT_MAX_EXP;
668 static ETL_CONSTANT
int max_exponent10 = FLT_MAX_10_EXP;
671 template <
typename T>
672 ETL_CONSTANT
int floating_point_limits_float<T>::digits;
674 template <
typename T>
675 ETL_CONSTANT
int floating_point_limits_float<T>::digits10;
677 template <
typename T>
678 ETL_CONSTANT
int floating_point_limits_float<T>::max_digits10;
680 template <
typename T>
681 ETL_CONSTANT
int floating_point_limits_float<T>::min_exponent;
683 template <
typename T>
684 ETL_CONSTANT
int floating_point_limits_float<T>::min_exponent10;
686 template <
typename T>
687 ETL_CONSTANT
int floating_point_limits_float<T>::max_exponent;
689 template <
typename T>
690 ETL_CONSTANT
int floating_point_limits_float<T>::max_exponent10;
694 template <
typename T =
void>
695 struct floating_point_limits_double
697 static ETL_CONSTANT
int digits = DBL_MANT_DIG;
698 static ETL_CONSTANT
int digits10 = DBL_DIG;
699 static ETL_CONSTANT
int max_digits10 = ETL_LOG10_OF_2(DBL_MANT_DIG) + 2;
701 static ETL_CONSTANT
int min_exponent = DBL_MIN_EXP;
702 static ETL_CONSTANT
int min_exponent10 = DBL_MIN_10_EXP;
703 static ETL_CONSTANT
int max_exponent = DBL_MAX_EXP;
704 static ETL_CONSTANT
int max_exponent10 = DBL_MAX_10_EXP;
707 template <
typename T>
708 ETL_CONSTANT
int floating_point_limits_double<T>::digits;
710 template <
typename T>
711 ETL_CONSTANT
int floating_point_limits_double<T>::digits10;
713 template <
typename T>
714 ETL_CONSTANT
int floating_point_limits_double<T>::max_digits10;
716 template <
typename T>
717 ETL_CONSTANT
int floating_point_limits_double<T>::min_exponent;
719 template <
typename T>
720 ETL_CONSTANT
int floating_point_limits_double<T>::min_exponent10;
722 template <
typename T>
723 ETL_CONSTANT
int floating_point_limits_double<T>::max_exponent;
725 template <
typename T>
726 ETL_CONSTANT
int floating_point_limits_double<T>::max_exponent10;
730 template <
typename T =
void>
731 struct floating_point_limits_long_double
733 static ETL_CONSTANT
int digits = LDBL_MANT_DIG;
734 static ETL_CONSTANT
int digits10 = LDBL_DIG;
735 static ETL_CONSTANT
int max_digits10 = ETL_LOG10_OF_2(LDBL_MANT_DIG) + 2;
737 static ETL_CONSTANT
int min_exponent = LDBL_MIN_EXP;
738 static ETL_CONSTANT
int min_exponent10 = LDBL_MIN_10_EXP;
739 static ETL_CONSTANT
int max_exponent = LDBL_MAX_EXP;
740 static ETL_CONSTANT
int max_exponent10 = LDBL_MAX_10_EXP;
743 template <
typename T>
744 ETL_CONSTANT
int floating_point_limits_long_double<T>::digits;
746 template <
typename T>
747 ETL_CONSTANT
int floating_point_limits_long_double<T>::digits10;
749 template <
typename T>
750 ETL_CONSTANT
int floating_point_limits_long_double<T>::max_digits10;
752 template <
typename T>
753 ETL_CONSTANT
int floating_point_limits_long_double<T>::min_exponent;
755 template <
typename T>
756 ETL_CONSTANT
int floating_point_limits_long_double<T>::min_exponent10;
758 template <
typename T>
759 ETL_CONSTANT
int floating_point_limits_long_double<T>::max_exponent;
761 template <
typename T>
762 ETL_CONSTANT
int floating_point_limits_long_double<T>::max_exponent10;
767 template <
typename T>
770 template <
typename T>
775 template <
typename T>
780 template <
typename T>
789 :
public private_limits::integral_limits_common<>
790 ,
public private_limits::integral_limits_bool<>
794 static ETL_CONSTEXPR
bool min()
798 static ETL_CONSTEXPR
bool max()
802 static ETL_CONSTEXPR
bool lowest()
806 static ETL_CONSTEXPR
bool epsilon()
810 static ETL_CONSTEXPR
bool round_error()
814 static ETL_CONSTEXPR
bool denorm_min()
818 static ETL_CONSTEXPR
bool infinity()
822 static ETL_CONSTEXPR
bool quiet_NaN()
826 static ETL_CONSTEXPR
bool signaling_NaN()
836 :
public private_limits::integral_limits_common<>
837 ,
public private_limits::integral_limits_char<>
841 static ETL_CONSTEXPR
char min()
843 return char(CHAR_MIN);
845 static ETL_CONSTEXPR
char max()
847 return char(CHAR_MAX);
849 static ETL_CONSTEXPR
char lowest()
851 return char(CHAR_MIN);
853 static ETL_CONSTEXPR
char epsilon()
857 static ETL_CONSTEXPR
char round_error()
861 static ETL_CONSTEXPR
char denorm_min()
865 static ETL_CONSTEXPR
char infinity()
869 static ETL_CONSTEXPR
char quiet_NaN()
873 static ETL_CONSTEXPR
char signaling_NaN()
883 :
public private_limits::integral_limits_common<>
884 ,
public private_limits::integral_limits_unsigned_char<>
888 static ETL_CONSTEXPR
unsigned char min()
892 static ETL_CONSTEXPR
unsigned char max()
896 static ETL_CONSTEXPR
unsigned char lowest()
900 static ETL_CONSTEXPR
unsigned char epsilon()
904 static ETL_CONSTEXPR
unsigned char round_error()
908 static ETL_CONSTEXPR
unsigned char denorm_min()
912 static ETL_CONSTEXPR
unsigned char infinity()
916 static ETL_CONSTEXPR
unsigned char quiet_NaN()
920 static ETL_CONSTEXPR
unsigned char signaling_NaN()
930 :
public private_limits::integral_limits_common<>
931 ,
public private_limits::integral_limits_signed_char<>
935 static ETL_CONSTEXPR
signed char min()
939 static ETL_CONSTEXPR
signed char max()
943 static ETL_CONSTEXPR
signed char lowest()
947 static ETL_CONSTEXPR
signed char epsilon()
951 static ETL_CONSTEXPR
signed char round_error()
955 static ETL_CONSTEXPR
signed char denorm_min()
959 static ETL_CONSTEXPR
signed char infinity()
963 static ETL_CONSTEXPR
signed char quiet_NaN()
967 static ETL_CONSTEXPR
signed char signaling_NaN()
973 #if ETL_HAS_NATIVE_CHAR8_T
978 :
public private_limits::integral_limits_common<>
979 ,
public private_limits::integral_limits_char8_t<>
983 static ETL_CONSTEXPR
char8_t min()
985 return char8_t(CHAR_MIN);
987 static ETL_CONSTEXPR
char8_t max()
989 return char8_t(CHAR_MAX);
991 static ETL_CONSTEXPR
char8_t lowest()
993 return char8_t(CHAR_MIN);
995 static ETL_CONSTEXPR
char8_t epsilon()
999 static ETL_CONSTEXPR
char8_t round_error()
1003 static ETL_CONSTEXPR
char8_t denorm_min()
1007 static ETL_CONSTEXPR
char8_t infinity()
1011 static ETL_CONSTEXPR
char8_t quiet_NaN()
1015 static ETL_CONSTEXPR
char8_t signaling_NaN()
1022 #if ETL_HAS_NATIVE_CHAR16_T
1027 :
public private_limits::integral_limits_common<>
1028 ,
public private_limits::integral_limits_char16_t<>
1032 static ETL_CONSTEXPR
char16_t min()
1036 static ETL_CONSTEXPR
char16_t max()
1038 return UINT_LEAST16_MAX;
1040 static ETL_CONSTEXPR
char16_t lowest()
1044 static ETL_CONSTEXPR
char16_t epsilon()
1048 static ETL_CONSTEXPR
char16_t round_error()
1052 static ETL_CONSTEXPR
char16_t denorm_min()
1056 static ETL_CONSTEXPR
char16_t infinity()
1060 static ETL_CONSTEXPR
char16_t quiet_NaN()
1064 static ETL_CONSTEXPR
char16_t signaling_NaN()
1071 #if ETL_HAS_NATIVE_CHAR32_T
1076 :
public private_limits::integral_limits_common<>
1077 ,
public private_limits::integral_limits_char32_t<>
1081 static ETL_CONSTEXPR
char32_t min()
1085 static ETL_CONSTEXPR
char32_t max()
1087 return UINT_LEAST32_MAX;
1089 static ETL_CONSTEXPR
char32_t lowest()
1093 static ETL_CONSTEXPR
char32_t epsilon()
1097 static ETL_CONSTEXPR
char32_t round_error()
1101 static ETL_CONSTEXPR
char32_t denorm_min()
1105 static ETL_CONSTEXPR
char32_t infinity()
1109 static ETL_CONSTEXPR
char32_t quiet_NaN()
1113 static ETL_CONSTEXPR
char32_t signaling_NaN()
1124 :
public private_limits::integral_limits_common<>
1125 ,
public private_limits::integral_limits_wchar_t<>
1129 static ETL_CONSTEXPR
wchar_t min()
1133 static ETL_CONSTEXPR
wchar_t max()
1137 static ETL_CONSTEXPR
wchar_t lowest()
1141 static ETL_CONSTEXPR
wchar_t epsilon()
1145 static ETL_CONSTEXPR
wchar_t round_error()
1149 static ETL_CONSTEXPR
wchar_t denorm_min()
1153 static ETL_CONSTEXPR
wchar_t infinity()
1157 static ETL_CONSTEXPR
wchar_t quiet_NaN()
1161 static ETL_CONSTEXPR
wchar_t signaling_NaN()
1171 :
public private_limits::integral_limits_common<>
1172 ,
public private_limits::integral_limits_short<>
1176 static ETL_CONSTEXPR
short min()
1180 static ETL_CONSTEXPR
short max()
1184 static ETL_CONSTEXPR
short lowest()
1188 static ETL_CONSTEXPR
short epsilon()
1192 static ETL_CONSTEXPR
short round_error()
1196 static ETL_CONSTEXPR
short denorm_min()
1200 static ETL_CONSTEXPR
short infinity()
1204 static ETL_CONSTEXPR
short quiet_NaN()
1208 static ETL_CONSTEXPR
short signaling_NaN()
1218 :
public private_limits::integral_limits_common<>
1219 ,
public private_limits::integral_limits_unsigned_short<>
1223 static ETL_CONSTEXPR
unsigned short min()
1227 static ETL_CONSTEXPR
unsigned short max()
1231 static ETL_CONSTEXPR
unsigned short lowest()
1235 static ETL_CONSTEXPR
unsigned short epsilon()
1239 static ETL_CONSTEXPR
unsigned short round_error()
1243 static ETL_CONSTEXPR
unsigned short denorm_min()
1247 static ETL_CONSTEXPR
unsigned short infinity()
1251 static ETL_CONSTEXPR
unsigned short quiet_NaN()
1255 static ETL_CONSTEXPR
unsigned short signaling_NaN()
1265 :
public private_limits::integral_limits_common<>
1266 ,
public private_limits::integral_limits_int<>
1270 static ETL_CONSTEXPR
int min()
1274 static ETL_CONSTEXPR
int max()
1278 static ETL_CONSTEXPR
int lowest()
1282 static ETL_CONSTEXPR
int epsilon()
1286 static ETL_CONSTEXPR
int round_error()
1290 static ETL_CONSTEXPR
int denorm_min()
1294 static ETL_CONSTEXPR
int infinity()
1298 static ETL_CONSTEXPR
int quiet_NaN()
1302 static ETL_CONSTEXPR
int signaling_NaN()
1312 :
public private_limits::integral_limits_common<>
1313 ,
public private_limits::integral_limits_unsigned_int<>
1317 static ETL_CONSTEXPR
unsigned int min()
1321 static ETL_CONSTEXPR
unsigned int max()
1325 static ETL_CONSTEXPR
unsigned int lowest()
1329 static ETL_CONSTEXPR
unsigned int epsilon()
1333 static ETL_CONSTEXPR
unsigned int round_error()
1337 static ETL_CONSTEXPR
unsigned int denorm_min()
1341 static ETL_CONSTEXPR
unsigned int infinity()
1345 static ETL_CONSTEXPR
unsigned int quiet_NaN()
1349 static ETL_CONSTEXPR
unsigned int signaling_NaN()
1359 :
public private_limits::integral_limits_common<>
1360 ,
public private_limits::integral_limits_long<>
1364 static ETL_CONSTEXPR
long min()
1368 static ETL_CONSTEXPR
long max()
1372 static ETL_CONSTEXPR
long lowest()
1376 static ETL_CONSTEXPR
long epsilon()
1380 static ETL_CONSTEXPR
long round_error()
1384 static ETL_CONSTEXPR
long denorm_min()
1388 static ETL_CONSTEXPR
long infinity()
1392 static ETL_CONSTEXPR
long quiet_NaN()
1396 static ETL_CONSTEXPR
long signaling_NaN()
1406 :
public private_limits::integral_limits_common<>
1407 ,
public private_limits::integral_limits_unsigned_long<>
1411 static ETL_CONSTEXPR
unsigned long min()
1415 static ETL_CONSTEXPR
unsigned long max()
1419 static ETL_CONSTEXPR
unsigned long lowest()
1423 static ETL_CONSTEXPR
unsigned long epsilon()
1427 static ETL_CONSTEXPR
unsigned long round_error()
1431 static ETL_CONSTEXPR
unsigned long denorm_min()
1435 static ETL_CONSTEXPR
unsigned long infinity()
1439 static ETL_CONSTEXPR
unsigned long quiet_NaN()
1443 static ETL_CONSTEXPR
unsigned long signaling_NaN()
1453 :
public private_limits::integral_limits_common<>
1454 ,
public private_limits::integral_limits_long_long<>
1458 static ETL_CONSTEXPR
long long min()
1462 static ETL_CONSTEXPR
long long max()
1466 static ETL_CONSTEXPR
long long lowest()
1470 static ETL_CONSTEXPR
long long epsilon()
1474 static ETL_CONSTEXPR
long long round_error()
1478 static ETL_CONSTEXPR
long long denorm_min()
1482 static ETL_CONSTEXPR
long long infinity()
1486 static ETL_CONSTEXPR
long long quiet_NaN()
1490 static ETL_CONSTEXPR
long long signaling_NaN()
1500 :
public private_limits::integral_limits_common<>
1501 ,
public private_limits::integral_limits_unsigned_long_long<>
1505 static ETL_CONSTEXPR
unsigned long long min()
1509 static ETL_CONSTEXPR
unsigned long long max()
1513 static ETL_CONSTEXPR
unsigned long long lowest()
1517 static ETL_CONSTEXPR
unsigned long long epsilon()
1521 static ETL_CONSTEXPR
unsigned long long round_error()
1525 static ETL_CONSTEXPR
unsigned long long denorm_min()
1529 static ETL_CONSTEXPR
unsigned long long infinity()
1533 static ETL_CONSTEXPR
unsigned long long quiet_NaN()
1537 static ETL_CONSTEXPR
unsigned long long signaling_NaN()
1547 :
public private_limits::floating_point_limits_common<>
1548 ,
public private_limits::floating_point_limits_float<>
1552 static ETL_CONSTEXPR
float min()
1556 static ETL_CONSTEXPR
float max()
1560 static ETL_CONSTEXPR
float lowest()
1564 static ETL_CONSTEXPR
float epsilon()
1568 static ETL_CONSTEXPR
float denorm_min()
1572 static ETL_CONSTEXPR
float infinity()
1576 static float round_error()
1580 static float quiet_NaN()
1584 static float signaling_NaN()
1594 :
public private_limits::floating_point_limits_common<>
1595 ,
public private_limits::floating_point_limits_double<>
1599 static ETL_CONSTEXPR
double min()
1603 static ETL_CONSTEXPR
double max()
1607 static ETL_CONSTEXPR
double lowest()
1611 static ETL_CONSTEXPR
double epsilon()
1615 static ETL_CONSTEXPR
double denorm_min()
1619 static ETL_CONSTEXPR
double infinity()
1623 static double round_error()
1627 static double quiet_NaN()
1631 static double signaling_NaN()
1641 :
public private_limits::floating_point_limits_common<>
1642 ,
public private_limits::floating_point_limits_long_double<>
1646 static ETL_CONSTEXPR
long double min()
1650 static ETL_CONSTEXPR
long double max()
1654 static ETL_CONSTEXPR
long double lowest()
1658 static ETL_CONSTEXPR
long double epsilon()
1660 return LDBL_EPSILON;
1662 static ETL_CONSTEXPR
long double denorm_min()
1666 static ETL_CONSTEXPR
long double infinity()
1670 static long double round_error()
1674 static long double quiet_NaN()
1678 static long double signaling_NaN()
1691 enum float_round_style
1693 round_indeterminate = std::round_indeterminate,
1694 round_toward_zero = std::round_toward_zero,
1695 round_to_nearest = std::round_to_nearest,
1696 round_toward_infinity = std::round_toward_infinity,
1697 round_toward_neg_infinity = std::round_toward_neg_infinity,
1701 enum float_denorm_style
1703 denorm_indeterminate = std::denorm_indeterminate,
1704 denorm_absent = std::denorm_absent,
1705 denorm_present = std::denorm_present
1710 template <
typename T>
1713 template <
typename T>
1721#if defined(ETL_COMPILER_MICROSOFT)
1722 #pragma warning(pop)
bitset_ext
Definition absolute.h:40