31#ifndef ETL_LIMITS_INCLUDED
32#define ETL_LIMITS_INCLUDED
39#if ETL_NOT_USING_STL && defined(ETL_COMPILER_ARM5) && !defined(__USE_C99_MATH)
41 #define __USE_C99_MATH
51#if defined(ETL_COMPILER_MICROSOFT)
53 #pragma warning(disable : 26812)
57 #define ETL_LOG10_OF_2(x) (((x) * 301) / 1000)
59#if !defined(LDBL_MIN) && defined(DBL_MIN)
62 #define LDBL_MIN DBL_MIN
63 #define LDBL_MAX DBL_MAX
64 #define LDBL_EPSILON DBL_EPSILON
65 #define LDBL_MANT_DIG DBL_MANT_DIG
66 #define LDBL_DIG DBL_DIG
67 #define LDBL_MIN_EXP DBL_MIN_EXP
68 #define LDBL_MIN_10_EXP DBL_MIN_10_EXP
69 #define LDBL_MAX_EXP DBL_MAX_EXP
70 #define LDBL_MAX_10_EXP DBL_MAX_10_EXP
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>
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>
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>
238 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
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>
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>
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>
308 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
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>
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>
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>
382 static ETL_CONSTANT
int digits10 = ETL_LOG10_OF_2(digits);
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
768 class numeric_limits;
770 template <
typename T>
771 class numeric_limits<const T> :
public numeric_limits<T> { };
773 template <
typename T>
774 class numeric_limits<volatile T> :
public numeric_limits<T> { };
776 template <
typename T>
777 class numeric_limits<const volatile T> :
public numeric_limits<T> { };
782 class numeric_limits<bool> :
public private_limits::integral_limits_common<>,
783 public private_limits::integral_limits_bool<>
787 static ETL_CONSTEXPR
bool min() {
return false; }
788 static ETL_CONSTEXPR
bool max() {
return true; }
789 static ETL_CONSTEXPR
bool lowest() {
return false; }
790 static ETL_CONSTEXPR
bool epsilon() {
return false; }
791 static ETL_CONSTEXPR
bool round_error() {
return false; }
792 static ETL_CONSTEXPR
bool denorm_min() {
return false; }
793 static ETL_CONSTEXPR
bool infinity() {
return false; }
794 static ETL_CONSTEXPR
bool quiet_NaN() {
return false; }
795 static ETL_CONSTEXPR
bool signaling_NaN() {
return false; }
801 class numeric_limits<char> :
public private_limits::integral_limits_common<>,
802 public private_limits::integral_limits_char<>
806 static ETL_CONSTEXPR
char min() {
return char(CHAR_MIN); }
807 static ETL_CONSTEXPR
char max() {
return char(CHAR_MAX); }
808 static ETL_CONSTEXPR
char lowest() {
return char(CHAR_MIN); }
809 static ETL_CONSTEXPR
char epsilon() {
return 0; }
810 static ETL_CONSTEXPR
char round_error() {
return 0; }
811 static ETL_CONSTEXPR
char denorm_min() {
return 0; }
812 static ETL_CONSTEXPR
char infinity() {
return 0; }
813 static ETL_CONSTEXPR
char quiet_NaN() {
return 0; }
814 static ETL_CONSTEXPR
char signaling_NaN() {
return 0; }
820 class numeric_limits<unsigned char> :
public private_limits::integral_limits_common<>,
821 public private_limits::integral_limits_unsigned_char<>
825 static ETL_CONSTEXPR
unsigned char min() {
return 0U; }
826 static ETL_CONSTEXPR
unsigned char max() {
return UCHAR_MAX; }
827 static ETL_CONSTEXPR
unsigned char lowest() {
return 0U; }
828 static ETL_CONSTEXPR
unsigned char epsilon() {
return 0U; }
829 static ETL_CONSTEXPR
unsigned char round_error() {
return 0U; }
830 static ETL_CONSTEXPR
unsigned char denorm_min() {
return 0U; }
831 static ETL_CONSTEXPR
unsigned char infinity() {
return 0U; }
832 static ETL_CONSTEXPR
unsigned char quiet_NaN() {
return 0U; }
833 static ETL_CONSTEXPR
unsigned char signaling_NaN() {
return 0U; }
839 class numeric_limits<signed char> :
public private_limits::integral_limits_common<>,
840 public private_limits::integral_limits_signed_char<>
844 static ETL_CONSTEXPR
signed char min() {
return SCHAR_MIN; }
845 static ETL_CONSTEXPR
signed char max() {
return SCHAR_MAX; }
846 static ETL_CONSTEXPR
signed char lowest() {
return SCHAR_MIN; }
847 static ETL_CONSTEXPR
signed char epsilon() {
return 0; }
848 static ETL_CONSTEXPR
signed char round_error() {
return 0; }
849 static ETL_CONSTEXPR
signed char denorm_min() {
return 0; }
850 static ETL_CONSTEXPR
signed char infinity() {
return 0; }
851 static ETL_CONSTEXPR
signed char quiet_NaN() {
return 0; }
852 static ETL_CONSTEXPR
signed char signaling_NaN() {
return 0; }
855#if ETL_HAS_NATIVE_CHAR8_T
859 class numeric_limits<char8_t> :
public private_limits::integral_limits_common<>,
860 public private_limits::integral_limits_char8_t<>
864 static ETL_CONSTEXPR
char8_t min() {
return char8_t(CHAR_MIN); }
865 static ETL_CONSTEXPR
char8_t max() {
return char8_t(CHAR_MAX); }
866 static ETL_CONSTEXPR
char8_t lowest() {
return char8_t(CHAR_MIN); }
867 static ETL_CONSTEXPR
char8_t epsilon() {
return 0; }
868 static ETL_CONSTEXPR
char8_t round_error() {
return 0; }
869 static ETL_CONSTEXPR
char8_t denorm_min() {
return 0; }
870 static ETL_CONSTEXPR
char8_t infinity() {
return 0; }
871 static ETL_CONSTEXPR
char8_t quiet_NaN() {
return 0; }
872 static ETL_CONSTEXPR
char8_t signaling_NaN() {
return 0; }
876#if ETL_HAS_NATIVE_CHAR16_T
880 class numeric_limits<char16_t> :
public private_limits::integral_limits_common<>,
881 public private_limits::integral_limits_char16_t<>
885 static ETL_CONSTEXPR
char16_t min() {
return 0U; }
886 static ETL_CONSTEXPR
char16_t max() {
return UINT_LEAST16_MAX; }
887 static ETL_CONSTEXPR
char16_t lowest() {
return 0U; }
888 static ETL_CONSTEXPR
char16_t epsilon() {
return 0U; }
889 static ETL_CONSTEXPR
char16_t round_error() {
return 0U; }
890 static ETL_CONSTEXPR
char16_t denorm_min() {
return 0U; }
891 static ETL_CONSTEXPR
char16_t infinity() {
return 0U; }
892 static ETL_CONSTEXPR
char16_t quiet_NaN() {
return 0U; }
893 static ETL_CONSTEXPR
char16_t signaling_NaN() {
return 0U; }
897#if ETL_HAS_NATIVE_CHAR32_T
901 class numeric_limits<char32_t> :
public private_limits::integral_limits_common<>,
902 public private_limits::integral_limits_char32_t<>
906 static ETL_CONSTEXPR
char32_t min() {
return 0U; }
907 static ETL_CONSTEXPR
char32_t max() {
return UINT_LEAST32_MAX; }
908 static ETL_CONSTEXPR
char32_t lowest() {
return 0U; }
909 static ETL_CONSTEXPR
char32_t epsilon() {
return 0U; }
910 static ETL_CONSTEXPR
char32_t round_error() {
return 0U; }
911 static ETL_CONSTEXPR
char32_t denorm_min() {
return 0U; }
912 static ETL_CONSTEXPR
char32_t infinity() {
return 0U; }
913 static ETL_CONSTEXPR
char32_t quiet_NaN() {
return 0U; }
914 static ETL_CONSTEXPR
char32_t signaling_NaN() {
return 0U; }
921 class numeric_limits<wchar_t> :
public private_limits::integral_limits_common<>,
922 public private_limits::integral_limits_wchar_t<>
926 static ETL_CONSTEXPR
wchar_t min() {
return WCHAR_MIN; }
927 static ETL_CONSTEXPR
wchar_t max() {
return WCHAR_MAX; }
928 static ETL_CONSTEXPR
wchar_t lowest() {
return WCHAR_MIN; }
929 static ETL_CONSTEXPR
wchar_t epsilon() {
return wchar_t(0); }
930 static ETL_CONSTEXPR
wchar_t round_error() {
return wchar_t(0); }
931 static ETL_CONSTEXPR
wchar_t denorm_min() {
return wchar_t(0); }
932 static ETL_CONSTEXPR
wchar_t infinity() {
return wchar_t(0); }
933 static ETL_CONSTEXPR
wchar_t quiet_NaN() {
return wchar_t(0); }
934 static ETL_CONSTEXPR
wchar_t signaling_NaN() {
return wchar_t(0); }
940 class numeric_limits<short> :
public private_limits::integral_limits_common<>,
941 public private_limits::integral_limits_short<>
945 static ETL_CONSTEXPR
short min() {
return SHRT_MIN; }
946 static ETL_CONSTEXPR
short max() {
return SHRT_MAX; }
947 static ETL_CONSTEXPR
short lowest() {
return SHRT_MIN; }
948 static ETL_CONSTEXPR
short epsilon() {
return 0; }
949 static ETL_CONSTEXPR
short round_error() {
return 0; }
950 static ETL_CONSTEXPR
short denorm_min() {
return 0; }
951 static ETL_CONSTEXPR
short infinity() {
return 0; }
952 static ETL_CONSTEXPR
short quiet_NaN() {
return 0; }
953 static ETL_CONSTEXPR
short signaling_NaN() {
return 0; }
959 class numeric_limits<unsigned short> :
public private_limits::integral_limits_common<>,
960 public private_limits::integral_limits_unsigned_short<>
964 static ETL_CONSTEXPR
unsigned short min() {
return 0U; }
965 static ETL_CONSTEXPR
unsigned short max() {
return USHRT_MAX; }
966 static ETL_CONSTEXPR
unsigned short lowest() {
return 0U; }
967 static ETL_CONSTEXPR
unsigned short epsilon() {
return 0U; }
968 static ETL_CONSTEXPR
unsigned short round_error() {
return 0U; }
969 static ETL_CONSTEXPR
unsigned short denorm_min() {
return 0U; }
970 static ETL_CONSTEXPR
unsigned short infinity() {
return 0U; }
971 static ETL_CONSTEXPR
unsigned short quiet_NaN() {
return 0U; }
972 static ETL_CONSTEXPR
unsigned short signaling_NaN() {
return 0U; }
978 class numeric_limits<int> :
public private_limits::integral_limits_common<>,
979 public private_limits::integral_limits_int<>
983 static ETL_CONSTEXPR
int min() {
return INT_MIN; }
984 static ETL_CONSTEXPR
int max() {
return INT_MAX; }
985 static ETL_CONSTEXPR
int lowest() {
return INT_MIN; }
986 static ETL_CONSTEXPR
int epsilon() {
return 0; }
987 static ETL_CONSTEXPR
int round_error() {
return 0; }
988 static ETL_CONSTEXPR
int denorm_min() {
return 0; }
989 static ETL_CONSTEXPR
int infinity() {
return 0; }
990 static ETL_CONSTEXPR
int quiet_NaN() {
return 0; }
991 static ETL_CONSTEXPR
int signaling_NaN() {
return 0; }
997 class numeric_limits<unsigned int> :
public private_limits::integral_limits_common<>,
998 public private_limits::integral_limits_unsigned_int<>
1002 static ETL_CONSTEXPR
unsigned int min() {
return 0U; }
1003 static ETL_CONSTEXPR
unsigned int max() {
return UINT_MAX; }
1004 static ETL_CONSTEXPR
unsigned int lowest() {
return 0U; }
1005 static ETL_CONSTEXPR
unsigned int epsilon() {
return 0U; }
1006 static ETL_CONSTEXPR
unsigned int round_error() {
return 0U; }
1007 static ETL_CONSTEXPR
unsigned int denorm_min() {
return 0U; }
1008 static ETL_CONSTEXPR
unsigned int infinity() {
return 0U; }
1009 static ETL_CONSTEXPR
unsigned int quiet_NaN() {
return 0U; }
1010 static ETL_CONSTEXPR
unsigned int signaling_NaN() {
return 0U; }
1016 class numeric_limits<long> :
public private_limits::integral_limits_common<>,
1017 public private_limits::integral_limits_long<>
1021 static ETL_CONSTEXPR
long min() {
return LONG_MIN; }
1022 static ETL_CONSTEXPR
long max() {
return LONG_MAX; }
1023 static ETL_CONSTEXPR
long lowest() {
return LONG_MIN; }
1024 static ETL_CONSTEXPR
long epsilon() {
return 0; }
1025 static ETL_CONSTEXPR
long round_error() {
return 0; }
1026 static ETL_CONSTEXPR
long denorm_min() {
return 0; }
1027 static ETL_CONSTEXPR
long infinity() {
return 0; }
1028 static ETL_CONSTEXPR
long quiet_NaN() {
return 0; }
1029 static ETL_CONSTEXPR
long signaling_NaN() {
return 0; }
1035 class numeric_limits<unsigned long> :
public private_limits::integral_limits_common<>,
1036 public private_limits::integral_limits_unsigned_long<>
1040 static ETL_CONSTEXPR
unsigned long min() {
return 0U; }
1041 static ETL_CONSTEXPR
unsigned long max() {
return ULONG_MAX; }
1042 static ETL_CONSTEXPR
unsigned long lowest() {
return 0U; }
1043 static ETL_CONSTEXPR
unsigned long epsilon() {
return 0U; }
1044 static ETL_CONSTEXPR
unsigned long round_error() {
return 0U; }
1045 static ETL_CONSTEXPR
unsigned long denorm_min() {
return 0U; }
1046 static ETL_CONSTEXPR
unsigned long infinity() {
return 0U; }
1047 static ETL_CONSTEXPR
unsigned long quiet_NaN() {
return 0U; }
1048 static ETL_CONSTEXPR
unsigned long signaling_NaN() {
return 0U; }
1054 class numeric_limits<long long> :
public private_limits::integral_limits_common<>,
1055 public private_limits::integral_limits_long_long<>
1059 static ETL_CONSTEXPR
long long min() {
return LLONG_MIN; }
1060 static ETL_CONSTEXPR
long long max() {
return LLONG_MAX; }
1061 static ETL_CONSTEXPR
long long lowest() {
return LLONG_MIN; }
1062 static ETL_CONSTEXPR
long long epsilon() {
return 0; }
1063 static ETL_CONSTEXPR
long long round_error() {
return 0; }
1064 static ETL_CONSTEXPR
long long denorm_min() {
return 0; }
1065 static ETL_CONSTEXPR
long long infinity() {
return 0; }
1066 static ETL_CONSTEXPR
long long quiet_NaN() {
return 0; }
1067 static ETL_CONSTEXPR
long long signaling_NaN() {
return 0; }
1073 class numeric_limits<unsigned long long> :
public private_limits::integral_limits_common<>,
1074 public private_limits::integral_limits_unsigned_long_long<>
1078 static ETL_CONSTEXPR
unsigned long long min() {
return 0U; }
1079 static ETL_CONSTEXPR
unsigned long long max() {
return ULLONG_MAX; }
1080 static ETL_CONSTEXPR
unsigned long long lowest() {
return 0U; }
1081 static ETL_CONSTEXPR
unsigned long long epsilon() {
return 0U; }
1082 static ETL_CONSTEXPR
unsigned long long round_error() {
return 0U; }
1083 static ETL_CONSTEXPR
unsigned long long denorm_min() {
return 0U; }
1084 static ETL_CONSTEXPR
unsigned long long infinity() {
return 0U; }
1085 static ETL_CONSTEXPR
unsigned long long quiet_NaN() {
return 0U; }
1086 static ETL_CONSTEXPR
unsigned long long signaling_NaN() {
return 0U; }
1092 class numeric_limits<float> :
public private_limits::floating_point_limits_common<>,
1093 public private_limits::floating_point_limits_float<>
1097 static ETL_CONSTEXPR
float min() {
return FLT_MIN; }
1098 static ETL_CONSTEXPR
float max() {
return FLT_MAX; }
1099 static ETL_CONSTEXPR
float lowest() {
return -FLT_MAX; }
1100 static ETL_CONSTEXPR
float epsilon() {
return FLT_EPSILON; }
1101 static ETL_CONSTEXPR
float denorm_min() {
return FLT_MIN; }
1102 static ETL_CONSTEXPR
float infinity() {
return HUGE_VALF; }
1103 static float round_error() {
return 0.5f; }
1104 static float quiet_NaN() {
return ETL_NANF; }
1105 static float signaling_NaN() {
return ETL_NANF; }
1111 class numeric_limits<double> :
public private_limits::floating_point_limits_common<>,
1112 public private_limits::floating_point_limits_double<>
1116 static ETL_CONSTEXPR
double min() {
return DBL_MIN; }
1117 static ETL_CONSTEXPR
double max() {
return DBL_MAX; }
1118 static ETL_CONSTEXPR
double lowest() {
return -DBL_MAX; }
1119 static ETL_CONSTEXPR
double epsilon() {
return DBL_EPSILON; }
1120 static ETL_CONSTEXPR
double denorm_min() {
return DBL_MIN; }
1121 static ETL_CONSTEXPR
double infinity() {
return HUGE_VAL; }
1122 static double round_error() {
return 0.5; }
1123 static double quiet_NaN() {
return ETL_NAN; }
1124 static double signaling_NaN() {
return ETL_NAN; }
1130 class numeric_limits<long double> :
public private_limits::floating_point_limits_common<>,
1131 public private_limits::floating_point_limits_long_double<>
1135 static ETL_CONSTEXPR
long double min() {
return LDBL_MIN; }
1136 static ETL_CONSTEXPR
long double max() {
return LDBL_MAX; }
1137 static ETL_CONSTEXPR
long double lowest() {
return -LDBL_MAX; }
1138 static ETL_CONSTEXPR
long double epsilon() {
return LDBL_EPSILON; }
1139 static ETL_CONSTEXPR
long double denorm_min() {
return LDBL_MIN; }
1140 static ETL_CONSTEXPR
long double infinity() {
return HUGE_VALL; }
1141 static long double round_error() {
return 0.5L; }
1142 static long double quiet_NaN() {
return ETL_NANL; }
1143 static long double signaling_NaN() {
return ETL_NANL; }
1153 enum float_round_style
1155 round_indeterminate = std::round_indeterminate,
1156 round_toward_zero = std::round_toward_zero,
1157 round_to_nearest = std::round_to_nearest,
1158 round_toward_infinity = std::round_toward_infinity,
1159 round_toward_neg_infinity = std::round_toward_neg_infinity,
1162 enum float_denorm_style
1164 denorm_indeterminate = std::denorm_indeterminate,
1165 denorm_absent = std::denorm_absent,
1166 denorm_present = std::denorm_present
1170 template <
typename T>
1171 using numeric_limits = std::numeric_limits<T>;
1173 template <
typename T>
1181#if defined(ETL_COMPILER_MICROSOFT)
1182 #pragma warning(pop)
is_signed
Definition type_traits_generator.h:1011
is_unsigned
Definition type_traits_generator.h:1021
bitset_ext
Definition absolute.h:38
ETL_CONSTEXPR pair()
Default constructor.
Definition utility.h:176