ExRandom
3.0
|
Machinery to manipulate bases. More...
#include <exrandom/digit_arithmetic.hpp>
Static Public Attributes | |
static const uint_t | base |
static const uint_t | basem1 |
static const int | bits |
static const bool | power_of_two |
Related Functions | |
(Note that these are not member functions.) | |
typedef std::uint_fast32_t | uint_t |
const int | uint_w |
const uint_t | uint_m |
constexpr int | highest_bit_idx (unsigned x) |
Machinery to manipulate bases.
b | the base as an unsigned. |
Base b = 0 is treated as 232. b = 1 is disallowed.
Definition at line 62 of file digit_arithmetic.hpp.
|
related |
The unsigned type used for random digits.
Definition at line 31 of file digit_arithmetic.hpp.
|
related |
The size of uint_t in bits.
Definition at line 37 of file digit_arithmetic.hpp.
|
related |
A mask for uint_t.
Definition at line 43 of file digit_arithmetic.hpp.
|
related |
x |
returns 0 for x = 0, 32 for x = uint_m
Definition at line 52 of file digit_arithmetic.hpp.
|
static |
The base (or 0 if the base is 232).
Definition at line 67 of file digit_arithmetic.hpp.
|
static |
The base less 1, in range [1, 232 − 1].
Definition at line 71 of file digit_arithmetic.hpp.
|
static |
The number of bits needed to hold a digit in [0, basem1].
Definition at line 75 of file digit_arithmetic.hpp.
|
static |
Is the base a power of 2?
Definition at line 80 of file digit_arithmetic.hpp.