openMSX
Classes | Namespaces | Functions | Variables
Math.hh File Reference
#include <bit>
#include <cassert>
#include <cmath>
#include <concepts>
#include <cstdint>
#include <numbers>
Include dependency graph for Math.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Math::QuotientRemainder
 Divide one integer by another, rounding towards minus infinity. More...
 

Namespaces

namespace  Math
 

Functions

constexpr auto Math::floodRight (std::unsigned_integral auto x) noexcept
 Returns the smallest number of the form 2^n-1 that is greater or equal to the given number. More...
 
int16_t Math::clipIntToShort (int x)
 Clip x to range [-32768,32767]. More...
 
uint8_t Math::clipIntToByte (int x)
 Clip x to range [0,255]. More...
 
constexpr unsigned Math::reverseNBits (unsigned x, unsigned bits)
 Reverse the lower N bits of a given value. More...
 
constexpr uint8_t Math::reverseByte (uint8_t a)
 Reverse the bits in a byte. More...
 
unsigned Math::findFirstSet (uint32_t x)
 Find the least significant bit that is set. More...
 
constexpr float Math::cubicHermite (const float *y, float x)
 
constexpr QuotientRemainder Math::div_mod_floor (int dividend, int divisor)
 
constexpr int Math::div_floor (int dividend, int divisor)
 
constexpr int Math::mod_floor (int dividend, int divisor)
 

Variables

constexpr double Math::e = std::numbers::e_v <double>
 
constexpr double Math::ln2 = std::numbers::ln2_v <double>
 
constexpr double Math::ln10 = std::numbers::ln10_v<double>
 
constexpr double Math::pi = std::numbers::pi_v <double>