General Utility Library for C++14  2.11
Namespaces | Functions
gcd_lcm.h File Reference

Detailed Description

Declarations of gcd() and lcm().

Authors
General Utility Library Contributors
Date
Created on 5 August 2022

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the license, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

#include <type_traits>
#include "gul14/internal.h"
#include "gul14/num_util.h"
Include dependency graph for gcd_lcm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 gul14
 Namespace gul14 contains all functions and classes of the General Utility Library.
 

Functions

template<typename IntTypeA , typename IntTypeB >
constexpr auto gul14::gcd (IntTypeA a, IntTypeB b)
 Calculate the greatest common divisor of two integers using the Euclidean algorithm. More...
 
template<typename IntTypeA , typename IntTypeB >
constexpr auto gul14::lcm (IntTypeA a, IntTypeB b)
 Calculate the least common multiple of two integers. More...