The application provides a log function
lookup table method based on a float
data format, which utilizes the storage format of
floating point data to quickly calculate the value of log2 through
lookup table; the method comprises the following steps: S1, a
data separation stage: separating the input
floating point base and exponent; only the base is subjected to
lookup table; S2, a lookup table construction: constructing a lookup table, wherein each entry comprises a
floating point number and a corresponding pre-computed result; S3, a quick retrieval: when the result of a certain floating point number needs to be calculated, the corresponding pre-computed result is directly retrieved in the lookup table, thereby avoiding complex floating point number calculation. Through the method, the precision loss can be effectively overcome, the accuracy of the calculation result is avoided to be affected, and the precision is higher than that of general direct lookup table. The calculation speed of projects such as
image processing, scientific calculation and financial analysis can be effectively improved, and the
system efficiency is improved.