gcd_lcm - GCD and LCMIntroductiondetail/gcd_lcm.hpp provides two generic integer algorithms: greatest common divisor and least common multiple. Synopsisnamespace details { namespace pool { template <typename Integer> Integer gcd(Integer A, Integer B); template <typename Integer> Integer lcm(Integer A, Integer B); } // namespace pool } // namespace details Semantics
Implementation NotesFor faster results, ensure A > B DependenciesNone. Future DirectionsThis header may be replaced by a Boost algorithms library. Revised 05 December, 2006 Copyright © 2000, 2001 Stephen Cleary (scleary AT jerviswebb DOT com) Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |