Warning, /include/c++/v1/__cxx03/ratio is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP___CXX03_RATIO
0011 #define _LIBCPP___CXX03_RATIO
0012
0013 /*
0014 ratio synopsis
0015
0016 namespace std
0017 {
0018
0019 template <intmax_t N, intmax_t D = 1>
0020 class ratio
0021 {
0022 public:
0023 static constexpr intmax_t num;
0024 static constexpr intmax_t den;
0025 typedef ratio<num, den> type;
0026 };
0027
0028 // ratio arithmetic
0029 template <class R1, class R2> using ratio_add = ...;
0030 template <class R1, class R2> using ratio_subtract = ...;
0031 template <class R1, class R2> using ratio_multiply = ...;
0032 template <class R1, class R2> using ratio_divide = ...;
0033
0034 // ratio comparison
0035 template <class R1, class R2> struct ratio_equal;
0036 template <class R1, class R2> struct ratio_not_equal;
0037 template <class R1, class R2> struct ratio_less;
0038 template <class R1, class R2> struct ratio_less_equal;
0039 template <class R1, class R2> struct ratio_greater;
0040 template <class R1, class R2> struct ratio_greater_equal;
0041
0042 // convenience SI typedefs
0043 using quecto = ratio <1, 1'000'000'000'000'000'000'000'000'000'000>; // Since C++26; not supported
0044 using ronto = ratio <1, 1'000'000'000'000'000'000'000'000'000>; // Since C++26; not supported
0045 typedef ratio<1, 1000000000000000000000000> yocto; // not supported
0046 typedef ratio<1, 1000000000000000000000> zepto; // not supported
0047 typedef ratio<1, 1000000000000000000> atto;
0048 typedef ratio<1, 1000000000000000> femto;
0049 typedef ratio<1, 1000000000000> pico;
0050 typedef ratio<1, 1000000000> nano;
0051 typedef ratio<1, 1000000> micro;
0052 typedef ratio<1, 1000> milli;
0053 typedef ratio<1, 100> centi;
0054 typedef ratio<1, 10> deci;
0055 typedef ratio< 10, 1> deca;
0056 typedef ratio< 100, 1> hecto;
0057 typedef ratio< 1000, 1> kilo;
0058 typedef ratio< 1000000, 1> mega;
0059 typedef ratio< 1000000000, 1> giga;
0060 typedef ratio< 1000000000000, 1> tera;
0061 typedef ratio< 1000000000000000, 1> peta;
0062 typedef ratio< 1000000000000000000, 1> exa;
0063 typedef ratio< 1000000000000000000000, 1> zetta; // not supported
0064 typedef ratio<1000000000000000000000000, 1> yotta; // not supported
0065 using ronna = ratio <1'000'000'000'000'000'000'000'000'000, 1>; // Since C++26; not supported
0066 using quetta = ratio <1'000'000'000'000'000'000'000'000'000'000, 1>; // Since C++26; not supported
0067
0068 // 20.11.5, ratio comparison
0069 template <class R1, class R2> inline constexpr bool ratio_equal_v
0070 = ratio_equal<R1, R2>::value; // C++17
0071 template <class R1, class R2> inline constexpr bool ratio_not_equal_v
0072 = ratio_not_equal<R1, R2>::value; // C++17
0073 template <class R1, class R2> inline constexpr bool ratio_less_v
0074 = ratio_less<R1, R2>::value; // C++17
0075 template <class R1, class R2> inline constexpr bool ratio_less_equal_v
0076 = ratio_less_equal<R1, R2>::value; // C++17
0077 template <class R1, class R2> inline constexpr bool ratio_greater_v
0078 = ratio_greater<R1, R2>::value; // C++17
0079 template <class R1, class R2> inline constexpr bool ratio_greater_equal_v
0080 = ratio_greater_equal<R1, R2>::value; // C++17
0081 }
0082 */
0083
0084 #include <__cxx03/__config>
0085 #include <__cxx03/__type_traits/integral_constant.h>
0086 #include <__cxx03/climits>
0087 #include <__cxx03/cstdint>
0088 #include <__cxx03/version>
0089
0090 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0091 # pragma GCC system_header
0092 #endif
0093
0094 _LIBCPP_PUSH_MACROS
0095 #include <__cxx03/__undef_macros>
0096
0097 _LIBCPP_BEGIN_NAMESPACE_STD
0098
0099 // __static_gcd
0100
0101 template <intmax_t _Xp, intmax_t _Yp>
0102 struct __static_gcd {
0103 static const intmax_t value = __static_gcd<_Yp, _Xp % _Yp>::value;
0104 };
0105
0106 template <intmax_t _Xp>
0107 struct __static_gcd<_Xp, 0> {
0108 static const intmax_t value = _Xp;
0109 };
0110
0111 template <>
0112 struct __static_gcd<0, 0> {
0113 static const intmax_t value = 1;
0114 };
0115
0116 // __static_lcm
0117
0118 template <intmax_t _Xp, intmax_t _Yp>
0119 struct __static_lcm {
0120 static const intmax_t value = _Xp / __static_gcd<_Xp, _Yp>::value * _Yp;
0121 };
0122
0123 template <intmax_t _Xp>
0124 struct __static_abs {
0125 static const intmax_t value = _Xp < 0 ? -_Xp : _Xp;
0126 };
0127
0128 template <intmax_t _Xp>
0129 struct __static_sign {
0130 static const intmax_t value = _Xp == 0 ? 0 : (_Xp < 0 ? -1 : 1);
0131 };
0132
0133 template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value>
0134 class __ll_add;
0135
0136 template <intmax_t _Xp, intmax_t _Yp>
0137 class __ll_add<_Xp, _Yp, 1> {
0138 static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
0139 static const intmax_t max = -min;
0140
0141 static_assert(_Xp <= max - _Yp, "overflow in __ll_add");
0142
0143 public:
0144 static const intmax_t value = _Xp + _Yp;
0145 };
0146
0147 template <intmax_t _Xp, intmax_t _Yp>
0148 class __ll_add<_Xp, _Yp, 0> {
0149 public:
0150 static const intmax_t value = _Xp;
0151 };
0152
0153 template <intmax_t _Xp, intmax_t _Yp>
0154 class __ll_add<_Xp, _Yp, -1> {
0155 static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
0156 static const intmax_t max = -min;
0157
0158 static_assert(min - _Yp <= _Xp, "overflow in __ll_add");
0159
0160 public:
0161 static const intmax_t value = _Xp + _Yp;
0162 };
0163
0164 template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value>
0165 class __ll_sub;
0166
0167 template <intmax_t _Xp, intmax_t _Yp>
0168 class __ll_sub<_Xp, _Yp, 1> {
0169 static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
0170 static const intmax_t max = -min;
0171
0172 static_assert(min + _Yp <= _Xp, "overflow in __ll_sub");
0173
0174 public:
0175 static const intmax_t value = _Xp - _Yp;
0176 };
0177
0178 template <intmax_t _Xp, intmax_t _Yp>
0179 class __ll_sub<_Xp, _Yp, 0> {
0180 public:
0181 static const intmax_t value = _Xp;
0182 };
0183
0184 template <intmax_t _Xp, intmax_t _Yp>
0185 class __ll_sub<_Xp, _Yp, -1> {
0186 static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
0187 static const intmax_t max = -min;
0188
0189 static_assert(_Xp <= max + _Yp, "overflow in __ll_sub");
0190
0191 public:
0192 static const intmax_t value = _Xp - _Yp;
0193 };
0194
0195 template <intmax_t _Xp, intmax_t _Yp>
0196 class __ll_mul {
0197 static const intmax_t nan = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1));
0198 static const intmax_t min = nan + 1;
0199 static const intmax_t max = -min;
0200 static const intmax_t __a_x = __static_abs<_Xp>::value;
0201 static const intmax_t __a_y = __static_abs<_Yp>::value;
0202
0203 static_assert(_Xp != nan && _Yp != nan && __a_x <= max / __a_y, "overflow in __ll_mul");
0204
0205 public:
0206 static const intmax_t value = _Xp * _Yp;
0207 };
0208
0209 template <intmax_t _Yp>
0210 class __ll_mul<0, _Yp> {
0211 public:
0212 static const intmax_t value = 0;
0213 };
0214
0215 template <intmax_t _Xp>
0216 class __ll_mul<_Xp, 0> {
0217 public:
0218 static const intmax_t value = 0;
0219 };
0220
0221 template <>
0222 class __ll_mul<0, 0> {
0223 public:
0224 static const intmax_t value = 0;
0225 };
0226
0227 // Not actually used but left here in case needed in future maintenance
0228 template <intmax_t _Xp, intmax_t _Yp>
0229 class __ll_div {
0230 static const intmax_t nan = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1));
0231 static const intmax_t min = nan + 1;
0232 static const intmax_t max = -min;
0233
0234 static_assert(_Xp != nan && _Yp != nan && _Yp != 0, "overflow in __ll_div");
0235
0236 public:
0237 static const intmax_t value = _Xp / _Yp;
0238 };
0239
0240 template <intmax_t _Num, intmax_t _Den = 1>
0241 class _LIBCPP_TEMPLATE_VIS ratio {
0242 static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
0243 static_assert(_Den != 0, "ratio divide by 0");
0244 static_assert(__static_abs<_Den>::value > 0, "ratio denominator is out of range");
0245 static _LIBCPP_CONSTEXPR const intmax_t __na = __static_abs<_Num>::value;
0246 static _LIBCPP_CONSTEXPR const intmax_t __da = __static_abs<_Den>::value;
0247 static _LIBCPP_CONSTEXPR const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value;
0248 static _LIBCPP_CONSTEXPR const intmax_t __gcd = __static_gcd<__na, __da>::value;
0249
0250 public:
0251 static _LIBCPP_CONSTEXPR const intmax_t num = __s * __na / __gcd;
0252 static _LIBCPP_CONSTEXPR const intmax_t den = __da / __gcd;
0253
0254 typedef ratio<num, den> type;
0255 };
0256
0257 template <intmax_t _Num, intmax_t _Den>
0258 _LIBCPP_CONSTEXPR const intmax_t ratio<_Num, _Den>::num;
0259
0260 template <intmax_t _Num, intmax_t _Den>
0261 _LIBCPP_CONSTEXPR const intmax_t ratio<_Num, _Den>::den;
0262
0263 template <class _Tp>
0264 struct __is_ratio : false_type {};
0265 template <intmax_t _Num, intmax_t _Den>
0266 struct __is_ratio<ratio<_Num, _Den> > : true_type {};
0267
0268 typedef ratio<1LL, 1000000000000000000LL> atto;
0269 typedef ratio<1LL, 1000000000000000LL> femto;
0270 typedef ratio<1LL, 1000000000000LL> pico;
0271 typedef ratio<1LL, 1000000000LL> nano;
0272 typedef ratio<1LL, 1000000LL> micro;
0273 typedef ratio<1LL, 1000LL> milli;
0274 typedef ratio<1LL, 100LL> centi;
0275 typedef ratio<1LL, 10LL> deci;
0276 typedef ratio< 10LL, 1LL> deca;
0277 typedef ratio< 100LL, 1LL> hecto;
0278 typedef ratio< 1000LL, 1LL> kilo;
0279 typedef ratio< 1000000LL, 1LL> mega;
0280 typedef ratio< 1000000000LL, 1LL> giga;
0281 typedef ratio< 1000000000000LL, 1LL> tera;
0282 typedef ratio< 1000000000000000LL, 1LL> peta;
0283 typedef ratio<1000000000000000000LL, 1LL> exa;
0284
0285 template <class _R1, class _R2>
0286 struct __ratio_multiply {
0287 private:
0288 static const intmax_t __gcd_n1_d2 = __static_gcd<_R1::num, _R2::den>::value;
0289 static const intmax_t __gcd_d1_n2 = __static_gcd<_R1::den, _R2::num>::value;
0290
0291 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0292 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0293
0294 public:
0295 typedef typename ratio< __ll_mul<_R1::num / __gcd_n1_d2, _R2::num / __gcd_d1_n2>::value,
0296 __ll_mul<_R2::den / __gcd_n1_d2, _R1::den / __gcd_d1_n2>::value >::type type;
0297 };
0298
0299 #ifndef _LIBCPP_CXX03_LANG
0300
0301 template <class _R1, class _R2>
0302 using ratio_multiply = typename __ratio_multiply<_R1, _R2>::type;
0303
0304 #else // _LIBCPP_CXX03_LANG
0305
0306 template <class _R1, class _R2>
0307 struct _LIBCPP_TEMPLATE_VIS ratio_multiply : public __ratio_multiply<_R1, _R2>::type {};
0308
0309 #endif // _LIBCPP_CXX03_LANG
0310
0311 template <class _R1, class _R2>
0312 struct __ratio_divide {
0313 private:
0314 static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
0315 static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
0316
0317 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0318 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0319
0320 public:
0321 typedef typename ratio< __ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value,
0322 __ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value >::type type;
0323 };
0324
0325 #ifndef _LIBCPP_CXX03_LANG
0326
0327 template <class _R1, class _R2>
0328 using ratio_divide = typename __ratio_divide<_R1, _R2>::type;
0329
0330 #else // _LIBCPP_CXX03_LANG
0331
0332 template <class _R1, class _R2>
0333 struct _LIBCPP_TEMPLATE_VIS ratio_divide : public __ratio_divide<_R1, _R2>::type {};
0334
0335 #endif // _LIBCPP_CXX03_LANG
0336
0337 template <class _R1, class _R2>
0338 struct __ratio_add {
0339 private:
0340 static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
0341 static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
0342
0343 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0344 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0345
0346 public:
0347 typedef typename ratio_multiply<
0348 ratio<__gcd_n1_n2, _R1::den / __gcd_d1_d2>,
0349 ratio< __ll_add< __ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value,
0350 __ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value >::value,
0351 _R2::den > >::type type;
0352 };
0353
0354 #ifndef _LIBCPP_CXX03_LANG
0355
0356 template <class _R1, class _R2>
0357 using ratio_add = typename __ratio_add<_R1, _R2>::type;
0358
0359 #else // _LIBCPP_CXX03_LANG
0360
0361 template <class _R1, class _R2>
0362 struct _LIBCPP_TEMPLATE_VIS ratio_add : public __ratio_add<_R1, _R2>::type {};
0363
0364 #endif // _LIBCPP_CXX03_LANG
0365
0366 template <class _R1, class _R2>
0367 struct __ratio_subtract {
0368 private:
0369 static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
0370 static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
0371
0372 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0373 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0374
0375 public:
0376 typedef typename ratio_multiply<
0377 ratio<__gcd_n1_n2, _R1::den / __gcd_d1_d2>,
0378 ratio< __ll_sub< __ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value,
0379 __ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value >::value,
0380 _R2::den > >::type type;
0381 };
0382
0383 #ifndef _LIBCPP_CXX03_LANG
0384
0385 template <class _R1, class _R2>
0386 using ratio_subtract = typename __ratio_subtract<_R1, _R2>::type;
0387
0388 #else // _LIBCPP_CXX03_LANG
0389
0390 template <class _R1, class _R2>
0391 struct _LIBCPP_TEMPLATE_VIS ratio_subtract : public __ratio_subtract<_R1, _R2>::type {};
0392
0393 #endif // _LIBCPP_CXX03_LANG
0394
0395 // ratio_equal
0396
0397 template <class _R1, class _R2>
0398 struct _LIBCPP_TEMPLATE_VIS ratio_equal : _BoolConstant<(_R1::num == _R2::num && _R1::den == _R2::den)> {
0399 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0400 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0401 };
0402
0403 template <class _R1, class _R2>
0404 struct _LIBCPP_TEMPLATE_VIS ratio_not_equal : _BoolConstant<!ratio_equal<_R1, _R2>::value> {
0405 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0406 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0407 };
0408
0409 // ratio_less
0410
0411 template <class _R1,
0412 class _R2,
0413 bool _Odd = false,
0414 intmax_t _Q1 = _R1::num / _R1::den,
0415 intmax_t _M1 = _R1::num % _R1::den,
0416 intmax_t _Q2 = _R2::num / _R2::den,
0417 intmax_t _M2 = _R2::num % _R2::den>
0418 struct __ratio_less1 {
0419 static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2;
0420 };
0421
0422 template <class _R1, class _R2, bool _Odd, intmax_t _Qp>
0423 struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, 0> {
0424 static const bool value = false;
0425 };
0426
0427 template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M2>
0428 struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, _M2> {
0429 static const bool value = !_Odd;
0430 };
0431
0432 template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1>
0433 struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, 0> {
0434 static const bool value = _Odd;
0435 };
0436
0437 template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1, intmax_t _M2>
0438 struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, _M2> {
0439 static const bool value = __ratio_less1<ratio<_R1::den, _M1>, ratio<_R2::den, _M2>, !_Odd>::value;
0440 };
0441
0442 template <class _R1,
0443 class _R2,
0444 intmax_t _S1 = __static_sign<_R1::num>::value,
0445 intmax_t _S2 = __static_sign<_R2::num>::value>
0446 struct __ratio_less {
0447 static const bool value = _S1 < _S2;
0448 };
0449
0450 template <class _R1, class _R2>
0451 struct __ratio_less<_R1, _R2, 1LL, 1LL> {
0452 static const bool value = __ratio_less1<_R1, _R2>::value;
0453 };
0454
0455 template <class _R1, class _R2>
0456 struct __ratio_less<_R1, _R2, -1LL, -1LL> {
0457 static const bool value = __ratio_less1<ratio<-_R2::num, _R2::den>, ratio<-_R1::num, _R1::den> >::value;
0458 };
0459
0460 template <class _R1, class _R2>
0461 struct _LIBCPP_TEMPLATE_VIS ratio_less : _BoolConstant<__ratio_less<_R1, _R2>::value> {
0462 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0463 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0464 };
0465
0466 template <class _R1, class _R2>
0467 struct _LIBCPP_TEMPLATE_VIS ratio_less_equal : _BoolConstant<!ratio_less<_R2, _R1>::value> {
0468 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0469 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0470 };
0471
0472 template <class _R1, class _R2>
0473 struct _LIBCPP_TEMPLATE_VIS ratio_greater : _BoolConstant<ratio_less<_R2, _R1>::value> {
0474 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0475 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0476 };
0477
0478 template <class _R1, class _R2>
0479 struct _LIBCPP_TEMPLATE_VIS ratio_greater_equal : _BoolConstant<!ratio_less<_R1, _R2>::value> {
0480 static_assert(__is_ratio<_R1>::value, "[ratio.general]/2 requires R1 to be a specialisation of the ratio template");
0481 static_assert(__is_ratio<_R2>::value, "[ratio.general]/2 requires R2 to be a specialisation of the ratio template");
0482 };
0483
0484 template <class _R1, class _R2>
0485 struct __ratio_gcd {
0486 typedef ratio<__static_gcd<_R1::num, _R2::num>::value, __static_lcm<_R1::den, _R2::den>::value> type;
0487 };
0488
0489 #if _LIBCPP_STD_VER >= 17
0490 template <class _R1, class _R2>
0491 inline constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value;
0492
0493 template <class _R1, class _R2>
0494 inline constexpr bool ratio_not_equal_v = ratio_not_equal<_R1, _R2>::value;
0495
0496 template <class _R1, class _R2>
0497 inline constexpr bool ratio_less_v = ratio_less<_R1, _R2>::value;
0498
0499 template <class _R1, class _R2>
0500 inline constexpr bool ratio_less_equal_v = ratio_less_equal<_R1, _R2>::value;
0501
0502 template <class _R1, class _R2>
0503 inline constexpr bool ratio_greater_v = ratio_greater<_R1, _R2>::value;
0504
0505 template <class _R1, class _R2>
0506 inline constexpr bool ratio_greater_equal_v = ratio_greater_equal<_R1, _R2>::value;
0507 #endif
0508
0509 _LIBCPP_END_NAMESPACE_STD
0510
0511 _LIBCPP_POP_MACROS
0512
0513 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0514 # include <__cxx03/type_traits>
0515 #endif
0516
0517 #endif // _LIBCPP___CXX03_RATIO