C++ Utilities 5.24.7
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Loading...
Searching...
No Matches
Namespaces | Functions
math.h File Reference
#include "../global.h"
#include "./traits.h"
#include <cstdint>
#include <limits>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  CppUtilities
 Contains all utilities provides by the c++utilities library.
 

Functions

template<typename IntegralType , Traits::EnableIf< std::is_integral< IntegralType > > * = nullptr>
constexpr IntegralType CppUtilities::digitsum (IntegralType number, IntegralType base=10)
 Returns the digitsum of the given number using the specified base.
 
template<typename IntegralType , Traits::EnableIf< std::is_integral< IntegralType > > * = nullptr>
constexpr IntegralType CppUtilities::factorial (IntegralType number)
 Returns the factorial of the given number.
 
template<typename IntegralType , Traits::EnableIf< std::is_integral< IntegralType >, std::is_unsigned< IntegralType > > * = nullptr>
constexpr IntegralType CppUtilities::powerModulo (const IntegralType base, const IntegralType exponent, const IntegralType module)
 Computes base power exponent modulo module.
 
template<typename IntegralType , Traits::EnableIf< std::is_integral< IntegralType >, std::is_unsigned< IntegralType > > * = nullptr>
constexpr IntegralType CppUtilities::inverseModulo (IntegralType number, IntegralType module)
 Computes the inverse of number modulo module.
 
template<typename IntegralType , Traits::EnableIf< std::is_integral< IntegralType >, std::is_unsigned< IntegralType > > * = nullptr>
constexpr IntegralType CppUtilities::orderModulo (const IntegralType number, const IntegralType module)
 Computes the order of number modulo module.
 
template<typename T >
constexprCppUtilities::min (T first, T second)
 Returns the smallest of the given items.
 
template<typename T1 , typename... T2>
constexpr T1 CppUtilities::min (T1 first, T1 second, T2... remaining)
 Returns the smallest of the given items.
 
template<typename T >
constexprCppUtilities::max (T first, T second)
 Returns the greatest of the given items.
 
template<typename T1 , typename... T2>
constexpr T1 CppUtilities::max (T1 first, T1 second, T2... remaining)
 Returns the greatest of the given items.