Bitcoin ABC
0.26.3
P2P Digital Currency

#include <cstdint>
Go to the source code of this file.
Functions  
static uint32_t  FastRange32 (uint32_t x, uint32_t n) 
This file offers implementations of the fast range reduction technique described in https://lemire.me/blog/2016/06/27/afastalternativetothemoduloreduction/. More...  
static uint64_t  FastRange64 (uint64_t x, uint64_t n) 
Fast range reduction with 64bit input and 64bit range. More...  

inlinestatic 
This file offers implementations of the fast range reduction technique described in https://lemire.me/blog/2016/06/27/afastalternativetothemoduloreduction/.
In short, they take an integer x and a range n, and return the upper bits of (x * n). If x is uniformly distributed over its domain, the result is as close to uniformly distributed over [0, n) as (x mod n) would be, but significantly faster. Fast range reduction with 32bit input and 32bit range.
Definition at line 22 of file fastrange.h.

inlinestatic 
Fast range reduction with 64bit input and 64bit range.
Definition at line 27 of file fastrange.h.