‹ BackHN Continuity

Thread

Subnormal floating-point numbers are expensive on Intel processors

69 points · 54 comments · zdw

  1. gwbas1c · · focus · HN ↗
    I'm still trying to understand what a subnormal number is; IE, I'm looking for the TLDR so I know just enough to know if I'm using them and need to learn more.

    Unfortunately, the Wikipedia article, while probably being accurate, doesn't give a clear and concise answer.

    IE, is 0.0001 a subnormal? Or is it 0.000000000000000000001?

    1. dgrunwald · · focus · HN ↗
      For 32-bit floats, subnormals are the numbers closer to 0 than 2**(-126) == 0.0000000000000000000000000000000000000117549. For 64-bit doubles, it's 2**(-1022), a number starting with 308 decimal zeroes.
      1. fuzzfactor · · focus · HN ↗
        What about 8-bit and 16-bit?
        1. nayuki · · focus · HN ↗
          8-bit: There is no IEEE 754 standard format.

          16-bit: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Half-precision_floating-point_format" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Half-precision_floating-point_...

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.