| 485 | |
| 486 | template <typename Integer> |
| 487 | inline typename boost::enable_if_c<std::numeric_limits<Integer>::is_specialized, boost::rational<Integer> >::type lcm(boost::rational<Integer> const &a, boost::rational<Integer> const &b) |
| 488 | { |
| 489 | return boost::rational<Integer>(static_cast<Integer>(lcm(a.numerator(), b.numerator())), static_cast<Integer>(gcd(a.denominator(), b.denominator()))); |
| 490 | } |
| 491 | /** |
| 492 | * Knuth, The Art of Computer Programming: Volume 2, Third edition, 1998 |
| 493 | * Chapter 4.5.2, Algorithm C: Greatest common divisor of n integers. |
no test coverage detected