Using Integer Addition to Approximate Float Multiplication
1 min read
Summary
Floating point calculations, which were originally the domain of scientific and business computing, are now almost omnipresent, found in devices including video game consoles and large language models.
However, it is still possible to achieve accuracy using integer-based calculations, such as approximating floating point multiplication through integer addition.
This is achieved by adding the two inputs as integer values, before adjusting the exponent.
While there are inherent problems to this method, including underflow and overflow, as well as specific floating point inputs, in certain contexts such as video games or LLMs, a accuracy of around 7.5% is good enough, and the method may well be more energy efficient.