how to create lookup table ?
A lookup table is just an array of constant data. You might pre-calculate data and use a static initializer, or perhaps you just allocate some RAM and execute an algorithm at init time to fill the array. Here's an lame example that uses a lookup table to calculate the square roots of integers: U16 sqrt[4] = { 0, 1000, 1414, 1732 }; U16 lameSqrt (U16 n) { return sqrt[n]; }