/third_party/ffmpeg/libavutil/ |
D | rational.c | 36 int64_t num, int64_t den, int64_t max) in av_reduce() argument 39 int sign = (num < 0) ^ (den < 0); in av_reduce() 40 int64_t gcd = av_gcd(FFABS(num), FFABS(den)); in av_reduce() 44 den = FFABS(den) / gcd; in av_reduce() 46 if (num <= max && den <= max) { in av_reduce() 47 a1 = (AVRational) { num, den }; in av_reduce() 48 den = 0; in av_reduce() 51 while (den) { in av_reduce() 52 uint64_t x = num / den; in av_reduce() 53 int64_t next_den = num - den * x; in av_reduce() [all …]
|
D | rational.h | 60 int den; ///< Denominator member 71 static inline AVRational av_make_q(int num, int den) in av_make_q() argument 73 AVRational r = { num, den }; in av_make_q() 90 const int64_t tmp= a.num * (int64_t)b.den - b.num * (int64_t)a.den; in av_cmp_q() 92 if(tmp) return (int)((tmp ^ a.den ^ b.den)>>63)|1; in av_cmp_q() 93 else if(b.den && a.den) return 0; in av_cmp_q() 105 return a.num / (double) a.den; in av_q2d() 120 int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max); 161 AVRational r = { q.den, q.num }; in av_inv_q()
|
/third_party/ffmpeg/libavutil/tests/ |
D | rational.c | 35 for (a.den = -2; a.den <= 2; a.den++) { in main() 37 for (b.den = -2; b.den <= 2; b.den++) { in main() 46 a.den, b.num, b.den, c,d); in main() 48 … if(b.den && (r.num*a.den != a.num*r.den || !r.num != !a.num || !r.den != !a.den)) in main() 49 av_log(NULL, AV_LOG_ERROR, "%d/%d ", r.num, r.den); in main() 91 for (a.den = 1; a.den <= 10; a.den++) { in main() 92 if (av_gcd(a.num, a.den) > 1) in main() 95 for (b.den = 1; b.den <= 10; b.den++) { in main() 97 if (av_gcd(b.num, b.den) > 1) in main() 110 a.den, b.num, b.den, acc, exact); in main() [all …]
|
/third_party/boost/libs/ratio/test/ |
D | typedefs_pass.cpp | 13 …o::num == 1 && boost::atto::den == 1000000000000000000ULL, NOTHING, (boost::mpl::integral_c<boost:… 14 BOOST_RATIO_STATIC_ASSERT(boost::femto::num == 1 && boost::femto::den == 1000000000000000ULL, NOTHI… 15 BOOST_RATIO_STATIC_ASSERT(boost::pico::num == 1 && boost::pico::den == 1000000000000ULL, NOTHING, (… 16 BOOST_RATIO_STATIC_ASSERT(boost::nano::num == 1 && boost::nano::den == 1000000000ULL, NOTHING, ()); 17 BOOST_RATIO_STATIC_ASSERT(boost::micro::num == 1 && boost::micro::den == 1000000ULL, NOTHING, ()); 18 BOOST_RATIO_STATIC_ASSERT(boost::milli::num == 1 && boost::milli::den == 1000ULL, NOTHING, ()); 19 BOOST_RATIO_STATIC_ASSERT(boost::centi::num == 1 && boost::centi::den == 100ULL, NOTHING, ()); 20 BOOST_RATIO_STATIC_ASSERT(boost::deci::num == 1 && boost::deci::den == 10ULL, NOTHING, ()); 21 …st::deca::num == 10ULL && boost::deca::den == 1, NOTHING, (boost::mpl::integral_c<boost::intmax_t,… 22 BOOST_RATIO_STATIC_ASSERT(boost::hecto::num == 100ULL && boost::hecto::den == 1, NOTHING, ()); [all …]
|
/third_party/uboot/u-boot-2020.01/arch/arm/mach-omap2/ |
D | utils.c | 12 static void do_cancel_out(u32 *num, u32 *den, u32 factor) in do_cancel_out() argument 16 ((*den)/factor*factor == (*den))) { in do_cancel_out() 18 (*den) /= factor; in do_cancel_out() 158 void cancel_out(u32 *num, u32 *den, u32 den_limit) in cancel_out() argument 160 do_cancel_out(num, den, 2); in cancel_out() 161 do_cancel_out(num, den, 3); in cancel_out() 162 do_cancel_out(num, den, 5); in cancel_out() 163 do_cancel_out(num, den, 7); in cancel_out() 164 do_cancel_out(num, den, 11); in cancel_out() 165 do_cancel_out(num, den, 13); in cancel_out() [all …]
|
/third_party/boost/boost/ratio/ |
D | ratio.hpp | 89 BOOST_STATIC_CONSTEXPR boost::intmax_t den = ABS_D / GCD; member in boost::ratio 103 ratio<_N2, _D2>::den == den) in ratio() argument 111 ratio<_N2, _D2>::den == den), 116 static value_type value() {return value_type(num,den);} in value() 119 typedef ratio<num, den> type; 126 const boost::intmax_t ratio<N, D>::den; member in boost::ratio<N, D> 170 (R1::num == R2::num && R1::den == R2::den)> 203 mpl::lcm_c<boost::intmax_t, R1::den, R2::den>::value>::type 216 : ratio<-R::num, R::den>::type 221 : ratio<mpl::abs_c<boost::intmax_t, R::num>::value, R::den>::type [all …]
|
/third_party/boost/boost/ratio/detail/ |
D | overflow_helpers.hpp | 200 static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value; 205 ratio<gcd_n1_n2, R1::den / gcd_d1_d2>, 210 boost::ratio_detail::br_mul<R1::num / gcd_n1_n2, R2::den / gcd_d1_d2>::value, 211 boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value 213 R2::den 231 static const boost::intmax_t gcd_d1_d2 = mpl::gcd_c<boost::intmax_t, R1::den, R2::den>::value; 236 ratio<gcd_n1_n2, R1::den / gcd_d1_d2>, 241 boost::ratio_detail::br_mul<R1::num / gcd_n1_n2, R2::den / gcd_d1_d2>::value, 242 boost::ratio_detail::br_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value 244 R2::den [all …]
|
/third_party/boost/boost/ |
D | rational.hpp | 181 rational() : num(0), den(1) {} in rational() 186 >::type const* = 0) : num(n), den(1) {} in rational() 191 >::type const* = 0) : num(n), den(d) { in rational() 198 : num(r.numerator()), den(is_normalized(int_type(r.numerator()), in rational() 205 : num(r.numerator()), den(is_normalized(int_type(r.numerator()), in rational() 284 const IntType& denominator() const { return den; } in denominator() 295 num += i * den; in operator +=() 301 num -= i * den; in operator -=() 308 IntType gcd = integer::gcd(static_cast<IntType>(i), den); in operator *=() 310 den /= gcd; in operator *=() [all …]
|
/third_party/boost/boost/chrono/io_v1/ |
D | chrono_io.hpp | 239 reduce(intermediate_type& r, unsigned long long& den, std::ios_base::iostate& err) in reduce() argument 244 common_type_t t = integer::gcd<common_type_t>(common_type_t(r), common_type_t(den)); in reduce() 246 den /= t; in reduce() 247 if (den != 1) in reduce() 303 unsigned long long den = 0; in operator >>() local 310 is >> num >> x >> den; in operator >>() 423 den = 1000000000000000000ULL; in operator >>() 427 den = 1000000000000000ULL; in operator >>() 431 den = 1000000000000ULL; in operator >>() 435 den = 1000000000ULL; in operator >>() [all …]
|
/third_party/ffmpeg/libavfilter/ |
D | vf_aspect.c | 80 if (sar.num && sar.den) { in compute_dar() 81 av_reduce(&dar->num, &dar->den, sar.num * (int64_t)w, sar.den * (int64_t)h, INT_MAX); in compute_dar() 83 av_reduce(&dar->num, &dar->den, w, h, INT_MAX); in compute_dar() 99 (double) inlink->sample_aspect_ratio.num / inlink->sample_aspect_ratio.den : 1; in get_aspect_ratio() 118 if (aspect_ratio->num < 0 || aspect_ratio->den <= 0) { in get_aspect_ratio() 141 if (s->dar.num && s->dar.den) { in setdar_config_props() 142 av_reduce(&s->sar.num, &s->sar.den, in setdar_config_props() 144 s->dar.den * inlink->w, INT_MAX); in setdar_config_props() 154 inlink->w, inlink->h, old_dar.num, old_dar.den, old_sar.num, old_sar.den, in setdar_config_props() 155 dar.num, dar.den, outlink->sample_aspect_ratio.num, outlink->sample_aspect_ratio.den); in setdar_config_props() [all …]
|
/third_party/boost/libs/ratio/test/ratio_arithmetic/ |
D | ratio_add_pass.cpp | 27 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 33 BOOST_RATIO_STATIC_ASSERT(R::num == 2 && R::den == 1, NOTHING, ()); in test() 35 BOOST_RATIO_STATIC_ASSERT(RR::num == 3 && RR::den == 1, NOTHING, ()); in test() 41 BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ()); in test() 47 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 53 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 59 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 65 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 71 … BOOST_RATIO_STATIC_ASSERT(R::num == 127970191639601LL && R::den == 5177331081415LL, NOTHING, ()); in test()
|
D | ratio_power_pass.cpp | 28 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 33 BOOST_RATIO_STATIC_ASSERT(R::num == 2 && R::den == 1, NOTHING, ()); in test() 38 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 43 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 4, NOTHING, ()); in test() 48 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 4, NOTHING, ()); in test() 53 BOOST_RATIO_STATIC_ASSERT(R::num == 4 && R::den == 9, NOTHING, ()); in test() 58 BOOST_RATIO_STATIC_ASSERT(R::num == 9 && R::den == 4, NOTHING, ()); in test()
|
D | ratio_subtract_pass.cpp | 28 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 34 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 40 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 46 BOOST_RATIO_STATIC_ASSERT(R::num == -3 && R::den == 2, NOTHING, ()); in test() 52 BOOST_RATIO_STATIC_ASSERT(R::num == -3 && R::den == 2, NOTHING, ()); in test() 58 BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ()); in test() 64 BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ()); in test() 70 … BOOST_RATIO_STATIC_ASSERT(R::num == -126708206685271LL && R::den == 5177331081415LL, NOTHING, ()); in test()
|
D | ratio_divide_pass.cpp | 27 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 33 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 39 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 45 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 51 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 57 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 63 BOOST_RATIO_STATIC_ASSERT(R::num == 630992477165LL && R::den == 127339199162436LL, NOTHING, ()); in test()
|
D | ratio_multiply_pass.cpp | 27 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 33 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 39 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 45 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 51 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 57 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 63 BOOST_RATIO_STATIC_ASSERT(R::num == 15519594064236LL && R::den == 5177331081415LL, NOTHING, ()); in test()
|
D | ratio_abs_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 34 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 39 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 44 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 49 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test()
|
D | ratio_negate_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 34 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 1, NOTHING, ()); in test() 39 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 44 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 49 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test()
|
/third_party/python/Modules/ |
D | _statisticsmodule.c | 33 double q, num, den, r, x; in _statistics__normal_dist_inv_cdf_impl() local 50 den = (((((((5.2264952788528545610e+3 * r + in _statistics__normal_dist_inv_cdf_impl() 58 if (den == 0.0) { in _statistics__normal_dist_inv_cdf_impl() 61 x = num / den; in _statistics__normal_dist_inv_cdf_impl() 80 den = (((((((1.05075007164441684324e-9 * r + in _statistics__normal_dist_inv_cdf_impl() 99 den = (((((((2.04426310338993978564e-15 * r + in _statistics__normal_dist_inv_cdf_impl() 108 if (den == 0.0) { in _statistics__normal_dist_inv_cdf_impl() 111 x = num / den; in _statistics__normal_dist_inv_cdf_impl()
|
/third_party/boost/boost/asio/detail/ |
D | chrono_time_traits.hpp | 160 const int64_t den1 = period_type::den / gcd<period_type::den, Den>::value; in duration_cast() 161 const int64_t den2 = Den / gcd<period_type::den, Den>::value; in duration_cast() 164 const int64_t den = num2 * den1; in duration_cast() local 166 if (num == 1 && den == 1) in duration_cast() 168 else if (num != 1 && den == 1) in duration_cast() 170 else if (num == 1 && period_type::den != 1) in duration_cast() 171 return ticks() / den; in duration_cast() 173 return ticks() * num / den; in duration_cast()
|
/third_party/boost/libs/ratio/test/ratio_extensions/ |
D | mpl_divides_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 35 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 41 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 47 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 53 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 59 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 65 BOOST_RATIO_STATIC_ASSERT(R::num == 630992477165LL && R::den == 127339199162436LL, NOTHING, ()); in test()
|
D | mpl_times_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 35 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 41 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 47 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 53 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 59 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 65 BOOST_RATIO_STATIC_ASSERT(R::num == 15519594064236LL && R::den == 5177331081415LL, NOTHING, ()); in test()
|
D | mpl_minus_pass.cpp | 30 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 36 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 42 BOOST_RATIO_STATIC_ASSERT(R::num == -3 && R::den == 2, NOTHING, ()); in test() 48 BOOST_RATIO_STATIC_ASSERT(R::num == -3 && R::den == 2, NOTHING, ()); in test() 54 BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ()); in test() 60 BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ()); in test() 66 … BOOST_RATIO_STATIC_ASSERT(R::num == -126708206685271LL && R::den == 5177331081415LL, NOTHING, ()); in test()
|
D | mpl_plus_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 2 && R::den == 1, NOTHING, ()); in test() 31 BOOST_RATIO_STATIC_ASSERT(RR::num == 3 && RR::den == 1, NOTHING, ()); in test() 37 BOOST_RATIO_STATIC_ASSERT(R::num == 3 && R::den == 2, NOTHING, ()); in test() 44 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 51 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 58 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 65 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 72 … BOOST_RATIO_STATIC_ASSERT(R::num == 127970191639601LL && R::den == 5177331081415LL, NOTHING, ()); in test()
|
D | mpl_abs_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 34 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 1, NOTHING, ()); in test() 39 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 44 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 49 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test()
|
D | mpl_negate_pass.cpp | 29 BOOST_RATIO_STATIC_ASSERT(R::num == 0 && R::den == 1, NOTHING, ()); in test() 34 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 1, NOTHING, ()); in test() 39 BOOST_RATIO_STATIC_ASSERT(R::num == -1 && R::den == 2, NOTHING, ()); in test() 44 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test() 49 BOOST_RATIO_STATIC_ASSERT(R::num == 1 && R::den == 2, NOTHING, ()); in test()
|