9#include "./cstdint.hpp"
21 template<stdex::
intmax_t _Val>
24 static const stdex::intmax_t value = _Val < 0 ? -1 : 1;
27 template<stdex::
intmax_t _Val>
30 static const stdex::intmax_t value = _Val * _sign_of<_Val>::value;
35 template<stdex::
intmax_t _Ax, stdex::
intmax_t _Bx>
38 static const stdex::intmax_t value = _gcdX<_Bx, _Ax % _Bx>::value;
41 template<stdex::
intmax_t _Ax>
44 static const stdex::intmax_t value = _Ax;
47 template<stdex::
intmax_t _Ax, stdex::
intmax_t _Bx>
50 static const stdex::intmax_t value =
51 _gcdX<_abs<_Ax>::value, _abs<_Bx>::value>::value;
57 static const stdex::intmax_t value = 1;
64 namespace ratio_asserts
67 struct overflow_in_multiplication_assert;
70 struct internal_library_error_assert;
73 struct denominator_cant_be_zero_assert;
79 struct division_by_zero;
82 struct overflow_in_addition_assert;
85 struct overflow_in_multiplication_assert<true>
87 typedef bool overflow_in_multiplication_assert_failed;
91 struct internal_library_error_assert<true>
93 typedef bool internal_library_error_assert_failed;
97 struct denominator_cant_be_zero_assert<true>
99 typedef bool denominator_cant_be_zero_assert_failed;
103 struct out_of_range<true>
105 typedef bool out_of_range_failed;
109 struct division_by_zero<true>
111 typedef bool division_by_zero_failed;
115 struct overflow_in_addition_assert<true>
117 typedef bool overflow_in_addition_assert_failed;
126 template<stdex::
intmax_t _Pn, stdex::
intmax_t _Qn,
bool>
127 struct _add_overflow_check_impl
129 static const stdex::intmax_t value = _Pn <= (STDEX_INTMAX_MAX - _Qn);
132 template<stdex::
intmax_t _Pn, stdex::
intmax_t _Qn>
133 struct _add_overflow_check_impl<_Pn, _Qn, false>
135 static const stdex::intmax_t value = _Pn >= (STDEX_INTMAX_MIN - _Qn);
138 template<stdex::
intmax_t _Pn, stdex::
intmax_t _Qn>
139 struct _add_overflow_check
140 : _add_overflow_check_impl<_Pn, _Qn, (_Qn >= 0)>
143 template<stdex::
intmax_t _Pn, stdex::
intmax_t _Qn>
146 static const stdex::intmax_t value = _Pn + _Qn;
151 typedef typename intern::ratio_asserts::overflow_in_addition_assert<bool(_add_overflow_check<_Pn, _Qn>::value != 0)>::
152 overflow_in_addition_assert_failed
156 struct _half_char_bit
158 static const stdex::uintmax_t value = (CHAR_BIT / 2);
162 typedef intern::ratio_asserts::internal_library_error_assert< ( (CHAR_BIT % 2) == 0 ) >::
163 internal_library_error_assert_failed
175 template<stdex::
intmax_t _Pn, stdex::
intmax_t _Qn>
176 struct _safe_multiply_helper
178 static const stdex::uintmax_t _c = stdex::uintmax_t(1) << (
sizeof(stdex::intmax_t) * _half_char_bit::value);
180 static const stdex::uintmax_t _a0 = _abs<_Pn>::value % _c;
181 static const stdex::uintmax_t _a1 = _abs<_Pn>::value / _c;
182 static const stdex::uintmax_t _b0 = _abs<_Qn>::value % _c;
183 static const stdex::uintmax_t _b1 = _abs<_Qn>::value / _c;
185 static const stdex::uintmax_t _intmax_max = STDEX_UINTMAX_C(STDEX_INTMAX_MAX);
188 template<stdex::
intmax_t _Pn, stdex::
intmax_t _Qn>
189 struct _safe_multiply
192 typedef _safe_multiply_helper<_Pn, _Qn> _helper_type;
194 typedef typename intern::ratio_asserts::overflow_in_multiplication_assert< bool(_helper_type::_a1 == 0 || _helper_type::_b1 == 0) >::
195 overflow_in_multiplication_assert_failed
197 typedef typename intern::ratio_asserts::overflow_in_multiplication_assert< bool(_helper_type::_a0 * _helper_type::_b1 + _helper_type::_b0 * _helper_type::_a1 < (_helper_type::_c / stdex::uintmax_t(2))) >::
198 overflow_in_multiplication_assert_failed
200 typedef typename intern::ratio_asserts::overflow_in_multiplication_assert< bool( _helper_type::_b0 * _helper_type::_a0 <= _helper_type::_intmax_max ) >::
201 overflow_in_multiplication_assert_failed
203 typedef typename intern::ratio_asserts::overflow_in_multiplication_assert< bool((_helper_type::_a0 * _helper_type::_b1 + _helper_type::_b0 * _helper_type::_a1) * _helper_type::_c <= _helper_type::_intmax_max - _helper_type::_b0 * _helper_type::_a0) >::
204 overflow_in_multiplication_assert_failed
208 static const stdex::intmax_t value = _Pn * _Qn;
215 template<stdex::u
intmax_t _hi1, stdex::u
intmax_t _lo1, stdex::u
intmax_t _hi2, stdex::u
intmax_t _lo2>
218 static const bool value = (_hi1 < _hi2 || (_hi1 == _hi2 && _lo1 < _lo2));
221 template<stdex::u
intmax_t _lo1, stdex::u
intmax_t _lo2>
224 static const stdex::uintmax_t value = (_lo1 + _lo2);
227 template<stdex::u
intmax_t _hi1, stdex::u
intmax_t _lo1, stdex::u
intmax_t _hi2, stdex::u
intmax_t _lo2>
230 typedef _big_add_lo<_lo1, _lo2> _lo_type;
231 static const stdex::uintmax_t _lo = _lo_type::value;
232 static const stdex::uintmax_t _hi = (_hi1 + _hi2 +
233 stdex::uintmax_t(_lo_type::value < _lo1) );
238 template<stdex::u
intmax_t _hi1, stdex::u
intmax_t _lo1, stdex::u
intmax_t _hi2, stdex::u
intmax_t _lo2>
239 struct _big_sub_helper
241 static const stdex::uintmax_t _lo = _lo1 - _lo2;
242 static const stdex::uintmax_t _hi = (_hi1 - _hi2 - (_lo1 < _lo2));
246 template<stdex::u
intmax_t _hi1, stdex::u
intmax_t _lo1, stdex::u
intmax_t _hi2, stdex::u
intmax_t _lo2>
249 typedef _big_sub_helper<_hi1, _lo1, _hi2, _lo2> _helper_type;
250 static const stdex::uintmax_t _lo = _helper_type::_lo;
251 static const stdex::uintmax_t _hi = _helper_type::_hi;
255 typedef typename intern::ratio_asserts::internal_library_error_assert< bool(!(_big_less<_hi1, _lo1, _hi2, _lo2>::value != 0)) >::
256 internal_library_error_assert_failed
261 template<stdex::u
intmax_t _x, stdex::u
intmax_t _y>
262 struct _big_multiply_helper1
264 static const stdex::uintmax_t _c = stdex::uintmax_t(1) << (
sizeof(stdex::intmax_t) * _half_char_bit::value);
265 static const stdex::uintmax_t _x0 = _x % _c;
266 static const stdex::uintmax_t _x1 = _x / _c;
267 static const stdex::uintmax_t _y0 = _y % _c;
268 static const stdex::uintmax_t _y1 = _y / _c;
271 template<stdex::u
intmax_t _x, stdex::u
intmax_t _y>
272 struct _big_multiply_helper2
274 typedef _big_multiply_helper1<_x, _y> _helper_type;
276 static const stdex::uintmax_t _x0y0 = _helper_type::_x0 * _helper_type::_y0;
277 static const stdex::uintmax_t _x0y1 = _helper_type::_x0 * _helper_type::_y1;
278 static const stdex::uintmax_t _x1y0 = _helper_type::_x1 * _helper_type::_y0;
279 static const stdex::uintmax_t _x1y1 = _helper_type::_x1 * _helper_type::_y1;
282 template<stdex::u
intmax_t _x, stdex::u
intmax_t _y>
283 struct _big_multiply_helper3
285 typedef _big_multiply_helper2<_x, _y> _helper_type;
287 static const stdex::uintmax_t _mix = _helper_type::_x0y1 + _helper_type::_x1y0;
290 template<stdex::u
intmax_t _x, stdex::u
intmax_t _y>
291 struct _big_multiply_helper
293 typedef _big_multiply_helper1<_x, _y> _helper_type1;
294 typedef _big_multiply_helper2<_x, _y> _helper_type2;
295 typedef _big_multiply_helper3<_x, _y> _helper_type3;
297 static const stdex::uintmax_t _mix_lo =
static_cast<const stdex::uintmax_t
>(_helper_type3::_mix) * _helper_type1::_c;
298 static const stdex::uintmax_t _mix_hi
299 = _helper_type3::_mix / _helper_type1::_c + ((_helper_type3::_mix < _helper_type2::_x0y1) ? _helper_type1::_c : 0);
303 template<stdex::u
intmax_t _x, stdex::u
intmax_t _y>
307 typedef _big_multiply_helper<_x, _y> _helper_type;
308 typedef _big_multiply_helper2<_x, _y> _helper_type2;
309 typedef _big_add<_helper_type::_mix_hi, _helper_type::_mix_lo, _helper_type2::_x1y1, _helper_type2::_x0y0> _Res;
311 static const stdex::uintmax_t _hi = _Res::_hi;
312 static const stdex::uintmax_t _lo = _Res::_lo;
318 template<stdex::
intmax_t _Num, stdex::
intmax_t _Den = 1>
321 static const stdex::intmax_t num =
322 _Num * _sign_of<_Den>::value / _gcd<_Num, _Den>::value;
324 static const stdex::intmax_t den =
325 _abs<_Den>::value / _gcd<_Num, _Den>::value;
330 template<stdex::
intmax_t _Num, stdex::
intmax_t _Den = 1>
334 static const stdex::intmax_t num =
335 detail::_ratio<_Num, _Den>::num;
337 static const stdex::intmax_t den =
338 detail::_ratio<_Num, _Den>::den;
342 detail::_ratio<_Num, _Den>::num,
343 detail::_ratio<_Num, _Den>::den
348 typedef typename intern::ratio_asserts::denominator_cant_be_zero_assert< bool(_Den != 0) >::
349 denominator_cant_be_zero_assert_failed
351 typedef typename intern::ratio_asserts::out_of_range<bool( (_Num >= -STDEX_INTMAX_MAX) && (_Den >= -STDEX_INTMAX_MAX) )>::
358 template<
class _R1,
class _R2>
359 struct _ratio_multiply_gcd
361 static const stdex::intmax_t _gcd1 =
362 _gcd<_R1::num, _R2::den>::value;
363 static const stdex::intmax_t _gcd2 =
364 _gcd<_R2::num, _R1::den>::value;
367 template<
class _R1,
class _R2>
368 struct _ratio_multiply
371 typedef _ratio_multiply_gcd<_R1, _R2> _gcd_type;
375 _safe_multiply<stdex::intmax_t(_R1::num / _gcd_type::_gcd1),
376 stdex::intmax_t(_R2::num / _gcd_type::_gcd2)>::value,
377 _safe_multiply<stdex::intmax_t(_R1::den / _gcd_type::_gcd2),
378 stdex::intmax_t(_R2::den / _gcd_type::_gcd1)>::value> type;
380 static const stdex::intmax_t num = type::num;
381 static const stdex::intmax_t den = type::den;
384 template<
class _R1,
class _R2>
385 struct _ratio_multiply_den
388 typedef _ratio_multiply_gcd<_R1, _R2> _gcd_type;
392 static const stdex::intmax_t value =
394 stdex::intmax_t(_R1::den / _gcd_type::_gcd2),
395 stdex::intmax_t(_R2::den / _gcd_type::_gcd1)
399 template<
class _R1,
class _R2>
400 struct _ratio_multiply_num
403 typedef _ratio_multiply_gcd<_R1, _R2> _gcd_type;
407 static const stdex::intmax_t value =
409 stdex::intmax_t(_R1::num / _gcd_type::_gcd1),
410 stdex::intmax_t(_R2::num / _gcd_type::_gcd2)
415 template<
class _R1,
class _R2>
416 struct ratio_multiply :
417 detail::_ratio_multiply<_R1, _R2>::type
423 template<
class _R1,
class _R2>
426 typedef typename ratio_multiply<
428 ratio<_R2::den, _R2::num> >::type type;
430 static const stdex::intmax_t num = type::num;
431 static const stdex::intmax_t den = type::den;
436 typedef typename intern::ratio_asserts::out_of_range< bool(_R2::num != 0) >::
441 template<
class _R1,
class _R2>
442 struct _ratio_divide_den
444 typedef _ratio_multiply_den<
446 ratio<_R2::den, _R2::num> > type;
448 static const stdex::intmax_t value = type::value;
452 typedef typename intern::ratio_asserts::out_of_range< bool(_R2::num != 0) >::
457 template<
class _R1,
class _R2>
458 struct _ratio_divide_num
460 typedef _ratio_multiply_num<
462 ratio<_R2::den, _R2::num> > type;
464 static const stdex::intmax_t value = type::value;
468 typedef typename intern::ratio_asserts::out_of_range< bool(_R2::num != 0) >::
474 template<
class _R1,
class _R2>
475 struct ratio_divide :
476 detail::_ratio_divide<_R1, _R2>::type
480 template<
class _R1,
class _R2>
483 static const bool value = _R1::num == _R2::num && _R1::den == _R2::den;
487 template<
class _R1,
class _R2>
488 struct ratio_not_equal
490 static const bool value = !ratio_equal<_R1, _R2>::value;
496 template<
class _R1,
class _R2,
497 class _Left = _big_multiply<_R1::num, _R2::den>,
498 class _Right = _big_multiply<_R2::num, _R1::den> >
499 struct _ratio_less_impl_1
501 static const bool value = _big_less<_Left::_hi, _Left::_lo, _Right::_hi, _Right::_lo>::value;
504 template<
class _R1,
class _R2,
505 bool = (_R1::num == 0 || _R2::num == 0
506 || (_sign_of<_R1::num>::value
507 != _sign_of<_R2::num>::value)),
508 bool = (_sign_of<_R1::num>::value == -1
509 && _sign_of<_R2::num>::value == -1)>
510 struct _ratio_less_impl :
511 _ratio_less_impl_1<_R1, _R2>
514 template<
class _R1,
class _R2>
515 struct _ratio_less_impl<_R1, _R2, true, false>
517 static const bool value = _R1::num < _R2::num;
520 template<
class _R1,
class _R2>
521 struct _ratio_less_impl<_R1, _R2, false, true> :
522 _ratio_less_impl_1< ratio<-_R2::num, _R2::den>, ratio<-_R1::num, _R1::den> >
527 template<
class _R1,
class _R2>
529 detail::_ratio_less_impl<_R1, _R2>
533 template<
class _R1,
class _R2>
534 struct ratio_less_equal
536 static const bool value = ratio_less<_R2, _R1>::value == bool(
false);
540 template<
class _R1,
class _R2>
543 static const bool value = ratio_less<_R2, _R1>::value;
547 template<
class _R1,
class _R2>
548 struct ratio_greater_equal
550 static const bool value = !ratio_less<_R1, _R2>::value;
556 template<
class _R1,
class _R2>
560 static const stdex::intmax_t _n1 = _R1::num;
561 static const stdex::intmax_t _d1 = _R1::den;
562 static const stdex::intmax_t _n2 = _R2::num;
563 static const stdex::intmax_t _d2 = _R2::den;
565 static const stdex::intmax_t _gx = _gcd<_d1, _d2>::value;
567 static const stdex::intmax_t _n = _safe_add<
568 _safe_multiply<_R1::num, stdex::intmax_t(_R2::den / _ratio_add::_gx)>::value,
569 _safe_multiply<_R2::num, stdex::intmax_t(_R1::den / _ratio_add::_gx)>::value>::value;
573 static const stdex::intmax_t _gx2 = _gcd<_ratio_add::_n, _ratio_add::_gx>::value;
580 stdex::intmax_t(_ratio_add::_n / _ratio_add::_gx2),
582 stdex::intmax_t(_R1::den / _ratio_add::_gx2), stdex::intmax_t(_R2::den / _ratio_add::_gx)
588 template<
class _R1,
class _R2>
590 detail::_ratio_add<_R1, _R2>::type
595 template<
class _R1,
class _R2>
596 struct _ratio_subtract
603 stdex::intmax_t(-_R2::num),
608 static const stdex::intmax_t num = type::num;
609 static const stdex::intmax_t den = type::den;
613 template<
class _R1,
class _R2>
614 struct ratio_subtract :
615 detail::_ratio_subtract<_R1, _R2>::type
620 template<
int _MaxBitsN>
621 struct _ratio_predefined_impl:
622 _ratio_predefined_impl<_MaxBitsN - 1>
628 static const stdex::uintmax_t value = STDEX_UINTMAX_C(10);
632 struct _10_pow_01<true>
634 static const stdex::uintmax_t value = STDEX_UINTMAX_C(1);
638 _10_pow_01_bit_n = 4,
639 _10_pow_02_bit_n = 7,
640 _10_pow_03_bit_n = 10,
641 _10_pow_06_bit_n = 20,
642 _10_pow_09_bit_n = 30,
643 _10_pow_12_bit_n = 40,
644 _10_pow_15_bit_n = 50,
645 _10_pow_18_bit_n = 60,
646 _10_pow_21_bit_n = 70,
647 _10_pow_24_bit_n = 80
650 #define _STDEX_10_POW(cond) _10_pow_01<(cond)>::value
651 #define _STDEX_INTMAX_BIT_COUNT (sizeof(stdex::intmax_t) * CHAR_BIT)
652 #define _STDEX_10_POW_IMPL(pow_n) _STDEX_10_POW(_10_pow_##pow_n##_bit_n > _STDEX_INTMAX_BIT_COUNT)
653 #define _STDEX_10_POW_01_IMPL(pow_n) (_STDEX_10_POW_IMPL(pow_n))
654 #define _STDEX_10_POW_02_IMPL(pow_n) (_STDEX_10_POW_01_IMPL(pow_n) * _STDEX_10_POW_01_IMPL(pow_n))
655 #define _STDEX_10_POW_03_IMPL(pow_n) (_STDEX_10_POW_01_IMPL(pow_n) * _STDEX_10_POW_02_IMPL(pow_n))
656 #define _STDEX_10_POW_06_IMPL(pow_n) (_STDEX_10_POW_03_IMPL(pow_n) * _STDEX_10_POW_03_IMPL(pow_n))
657 #define _STDEX_10_POW_09_IMPL(pow_n) (_STDEX_10_POW_03_IMPL(pow_n) * _STDEX_10_POW_06_IMPL(pow_n))
658 #define _STDEX_10_POW_12_IMPL(pow_n) (_STDEX_10_POW_06_IMPL(pow_n) * _STDEX_10_POW_06_IMPL(pow_n))
659 #define _STDEX_10_POW_15_IMPL(pow_n) (_STDEX_10_POW_06_IMPL(pow_n) * _STDEX_10_POW_09_IMPL(pow_n))
660 #define _STDEX_10_POW_18_IMPL(pow_n) (_STDEX_10_POW_09_IMPL(pow_n) * _STDEX_10_POW_09_IMPL(pow_n))
661 #define _STDEX_10_POW_21_IMPL(pow_n) (_STDEX_10_POW_09_IMPL(pow_n) * _STDEX_10_POW_12_IMPL(pow_n))
662 #define _STDEX_10_POW_24_IMPL(pow_n) (_STDEX_10_POW_12_IMPL(pow_n) * _STDEX_10_POW_12_IMPL(pow_n))
664 #define _STDEX_10_POW_01 _STDEX_10_POW_01_IMPL(01)
665 #define _STDEX_10_POW_02 _STDEX_10_POW_02_IMPL(02)
666 #define _STDEX_10_POW_03 _STDEX_10_POW_03_IMPL(03)
667 #define _STDEX_10_POW_06 _STDEX_10_POW_06_IMPL(06)
668 #define _STDEX_10_POW_09 _STDEX_10_POW_09_IMPL(09)
669 #define _STDEX_10_POW_12 _STDEX_10_POW_12_IMPL(12)
670 #define _STDEX_10_POW_15 _STDEX_10_POW_15_IMPL(15)
671 #define _STDEX_10_POW_18 _STDEX_10_POW_18_IMPL(18)
672 #define _STDEX_10_POW_21 _STDEX_10_POW_21_IMPL(21)
673 #define _STDEX_10_POW_24 _STDEX_10_POW_24_IMPL(24)
678 struct _ratio_predefined_impl<0>;
681 struct _ratio_predefined_impl<_10_pow_01_bit_n>;
684 struct _ratio_predefined_impl<_10_pow_02_bit_n>
686 struct type_cannot_be_implemented;
688 typedef type_cannot_be_implemented yocto;
689 typedef type_cannot_be_implemented zepto;
690 typedef type_cannot_be_implemented atto;
691 typedef type_cannot_be_implemented femto;
692 typedef type_cannot_be_implemented pico;
693 typedef type_cannot_be_implemented nano;
694 typedef type_cannot_be_implemented micro;
695 typedef type_cannot_be_implemented milli;
696 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_02)> centi;
697 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_01)> deci;
698 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_01), STDEX_INTMAX_C(1)> deca;
699 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_02), STDEX_INTMAX_C(1)> hecto;
700 typedef type_cannot_be_implemented kilo;
701 typedef type_cannot_be_implemented mega;
702 typedef type_cannot_be_implemented giga;
703 typedef type_cannot_be_implemented tera;
704 typedef type_cannot_be_implemented peta;
705 typedef type_cannot_be_implemented exa;
706 typedef type_cannot_be_implemented zetta;
707 typedef type_cannot_be_implemented yotta;
711 struct _ratio_predefined_impl<_10_pow_03_bit_n>:
712 _ratio_predefined_impl<_10_pow_02_bit_n>
714 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_03)> milli;
715 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_03), STDEX_INTMAX_C(1)> kilo;
719 struct _ratio_predefined_impl<_10_pow_06_bit_n>:
720 _ratio_predefined_impl<_10_pow_03_bit_n>
722 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_06)> micro;
723 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_06), STDEX_INTMAX_C(1)> mega;
727 struct _ratio_predefined_impl<_10_pow_09_bit_n>:
728 _ratio_predefined_impl<_10_pow_06_bit_n>
730 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_09)> nano;
731 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_09), STDEX_INTMAX_C(1)> giga;
735 struct _ratio_predefined_impl<_10_pow_12_bit_n>:
736 _ratio_predefined_impl<_10_pow_09_bit_n>
738 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_12)> pico;
739 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_12), STDEX_INTMAX_C(1)> tera;
743 struct _ratio_predefined_impl<_10_pow_15_bit_n>:
744 _ratio_predefined_impl<_10_pow_12_bit_n>
746 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_15)> femto;
747 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_15), STDEX_INTMAX_C(1)> peta;
751 struct _ratio_predefined_impl<_10_pow_18_bit_n>:
752 _ratio_predefined_impl<_10_pow_15_bit_n>
754 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_18)> atto;
755 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_18), STDEX_INTMAX_C(1)> exa;
759 struct _ratio_predefined_impl<_10_pow_21_bit_n>:
760 _ratio_predefined_impl<_10_pow_18_bit_n>
762 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_21)> zepto;
763 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_21), STDEX_INTMAX_C(1)> zetta;
767 struct _ratio_predefined_impl<_10_pow_24_bit_n>:
768 _ratio_predefined_impl<_10_pow_21_bit_n>
770 typedef ratio<STDEX_INTMAX_C(1), static_cast<stdex::intmax_t>(_STDEX_10_POW_24)> yocto;
771 typedef ratio<static_cast<stdex::intmax_t>(_STDEX_10_POW_24), STDEX_INTMAX_C(1)> yotta;
775 #undef _STDEX_INTMAX_BIT_COUNT
776 #undef _STDEX_10_POW_IMPL
778 #undef _STDEX_10_POW_01_IMPL
779 #undef _STDEX_10_POW_02_IMPL
780 #undef _STDEX_10_POW_03_IMPL
781 #undef _STDEX_10_POW_06_IMPL
782 #undef _STDEX_10_POW_09_IMPL
783 #undef _STDEX_10_POW_12_IMPL
784 #undef _STDEX_10_POW_15_IMPL
785 #undef _STDEX_10_POW_18_IMPL
786 #undef _STDEX_10_POW_21_IMPL
787 #undef _STDEX_10_POW_24_IMPL
789 #undef _STDEX_10_POW_01
790 #undef _STDEX_10_POW_02
791 #undef _STDEX_10_POW_03
792 #undef _STDEX_10_POW_06
793 #undef _STDEX_10_POW_09
794 #undef _STDEX_10_POW_12
795 #undef _STDEX_10_POW_15
796 #undef _STDEX_10_POW_18
797 #undef _STDEX_10_POW_21
798 #undef _STDEX_10_POW_24
800 struct _ratio_predefined:
801 _ratio_predefined_impl<(sizeof(stdex::intmax_t) * CHAR_BIT)>
805 typedef detail::_ratio_predefined::yocto yocto;
806 typedef detail::_ratio_predefined::zepto zepto;
807 typedef detail::_ratio_predefined::atto atto;
808 typedef detail::_ratio_predefined::femto femto;
809 typedef detail::_ratio_predefined::pico pico;
810 typedef detail::_ratio_predefined::nano nano;
811 typedef detail::_ratio_predefined::micro micro;
812 typedef detail::_ratio_predefined::milli milli;
813 typedef detail::_ratio_predefined::centi centi;
814 typedef detail::_ratio_predefined::deci deci;
815 typedef detail::_ratio_predefined::deca deca;
816 typedef detail::_ratio_predefined::hecto hecto;
817 typedef detail::_ratio_predefined::kilo kilo;
818 typedef detail::_ratio_predefined::mega mega;
819 typedef detail::_ratio_predefined::giga giga;
820 typedef detail::_ratio_predefined::tera tera;
821 typedef detail::_ratio_predefined::peta peta;
822 typedef detail::_ratio_predefined::exa exa;
823 typedef detail::_ratio_predefined::zetta zetta;
824 typedef detail::_ratio_predefined::yotta yotta;