‹ BackHN Continuity

Thread

More floating point alternatives

53 points · 51 comments · vismit2000

  1. klodolph · · focus · HN ↗
    Worth mentioning is storing the logarithm of the number.

    Seen it used in a couple places. Logarithmic depth buffer is one. Yamaha DX7 is another.

    1. mtklein · · focus · HN ↗
      That's kind of exactly what floats are. You store the log2 of the number, a bit for its sign, and in what remaining bits you have left some fixed-point scaling between adjacent powers.
      1. pkaye · · focus · HN ↗
        Floats are actually rational numbers with denominators of power of 2.

        <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dyadic_rational#In_computing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dyadic_rational#In_computing

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.