Buckets:

soixantesept's picture
download
raw
447 Bytes
#pragma once
/**
* This class provides a static (common) 1024-element lookup table for integer division
* Initialization will run multiple times, but the table is created only once
* @todo Split into declaration and definition
*/
class DivisionTable {
public:
static int* getDT() {
static int dt[1024];
for( int n = 0; n < 1024; ++n ) {
dt[n] = (1 << 30) / (n + 2); // 1/(n+2) scaled by 30 bits
}
return dt;
}
};

Xet Storage Details

Size:
447 Bytes
·
Xet hash:
72e2f057dcd2d9621af46db04a046fbcf37db1a9f67170eeccfb34f14b049c10

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.