Math static class.
More...
#include <math.h>
|
template<typename T > |
static T | GCD (T a, T b) |
| Computes the greatest common divisor of a and b. More...
|
|
template<typename T > |
static T | RoundUp (T a, T k) |
| Finds the smallest value x >= a such that x % k == 0. More...
|
|
static uint64_t | MulDiv64 (uint64_t operant, uint64_t multiplier, uint64_t divider) |
| Calculate (operant * multiplier / divider) with 64-bit unsigned integer values. More...
|
|
Math static class.
Contains useful math functions.
Thread-safe.
Definition at line 22 of file math.h.
◆ Math() [1/3]
CppCommon::Math::Math |
( |
| ) |
|
|
delete |
◆ Math() [2/3]
CppCommon::Math::Math |
( |
const Math & |
| ) |
|
|
delete |
◆ Math() [3/3]
CppCommon::Math::Math |
( |
Math && |
| ) |
|
|
delete |
◆ ~Math()
CppCommon::Math::~Math |
( |
| ) |
|
|
delete |
◆ GCD()
template<typename T >
static T CppCommon::Math::GCD |
( |
T |
a, |
|
|
T |
b |
|
) |
| |
|
static |
Computes the greatest common divisor of a and b.
- Parameters
-
- Returns
- Greatest common divisor of a and b
◆ MulDiv64()
uint64_t CppCommon::Math::MulDiv64 |
( |
uint64_t |
operant, |
|
|
uint64_t |
multiplier, |
|
|
uint64_t |
divider |
|
) |
| |
|
static |
Calculate (operant * multiplier / divider) with 64-bit unsigned integer values.
- Parameters
-
operant | - Operant |
multiplier | - Multiplier |
divider | - Divider |
- Returns
- Calculated value of (operant * multiplier / divider) expression
- Examples
- math_math.cpp.
Definition at line 17 of file math.cpp.
◆ operator=() [1/2]
Math& CppCommon::Math::operator= |
( |
const Math & |
| ) |
|
|
delete |
◆ operator=() [2/2]
Math& CppCommon::Math::operator= |
( |
Math && |
| ) |
|
|
delete |
◆ RoundUp()
template<typename T >
T CppCommon::Math::RoundUp |
( |
T |
a, |
|
|
T |
k |
|
) |
| |
|
inlinestatic |
Finds the smallest value x >= a such that x % k == 0.
- Parameters
-
- Returns
- Value x
Definition at line 27 of file math.inl.
The documentation for this class was generated from the following files: