Follow

Suddenly found, that fixed point logarithm could be an alternative to floating point. Multiplication and division are just addition and subtraction of logarithms. Addition and subtraction are not that easy, but \[\log\left(\exp a \pm \exp b\right) = a + f\left(b - a\right)\], where \[f(x) = \log\left(1 \pm \exp x\right)\] could be implemented as a lookup table (one for addition an one for subtraction). Of course, zero and negative values should be treated specially, but this is true for floating point too. (For negative values negative base logarithm should do the trick, if it is ok to have inexact negation).
P.s.Edited toot due to error in math

This is named Logarithmic Number System (LNS). Even Wikipedia have an article on in. Fun fact, it is invented at least three times (excluding toot above). Obvious idea, isn't it?

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.