Top
Best
New

Posted by SomaticPirate 9/12/2025

Float Exposed(float.exposed)
417 points | 114 commentspage 2
emergie 9/13/2025|
It would be nice if the site had an explanation why the decimal 0.1 has no finite representation in base-2 system. In short it's about factorization of the base of the system - base-2 lacks 5 that is present in base-10. It is analogous to 1/3 or 1/7 not having a finite representation in base-10 dot notation of a fraction.
llm_nerd 9/12/2025||
The best explanation on floats - https://dennisforbes.ca/blog/features/floating_point/underst...
rwmj 9/12/2025||
Good job on showing the hexadecimal version. I recently had a challenging C bug where I was using printf("%a") to show the underlying representation, which uses hexadecimal, and it was a little confusing at first. This site would have been helpful.
pmarreck 9/12/2025||
I'm glad this exists, except for the fact that IEEE754 is the devil, and posits are better (not assuming hardware support). (Even better than both are bignum rationals, but those are the slowest.)
the__alchemist 9/12/2025|
It's a compromise that works well in a broad range of approaches. All the alternatives perform better in some domains, and worse in others.
pmarreck 9/12/2025||
Fair enough. I just don't like the element of surprising inaccuracy.
librasteve 9/12/2025||
fantastic explanation and very nice to see both the decimal and binary representations together

https://raku.org defaults to Rationals (Rats) and provides FatRat for arbitrary precision

otherwise even relatively normal calculations (eg what’s the mass of electron in quectogram) fail

saghm 9/12/2025|
"FatRat" is a hilarious name for a numeric type (and I mean this in a purely positive way). I've always had an impression of Perl as a language with a bit of a quirky, fun community, and it's nice to see that might have carried over to Raku as well.
librasteve 9/12/2025||
well Larry (Wall) was a linguist and adept at coining memorable memes
saghm 9/12/2025||
For sure! I've honestly never written Perl, but I still often end up sharing the "three virtues" with junior engineers I work with. There's a certain timeless quality to a lot of the stuff he's come up with. (Plus, those of us who don't write Perl still owe him a debt of gratitude even just for the `patch` utility!)
noxa 9/12/2025||
Would be cool if this supported the various fp8 formats that have been shipped on GPUs recently!
tempodox 9/12/2025||
Fantastic. A visual interactive explanation of how floating-point representation works.
elvircrn 9/12/2025||
Good stuff. Having fp8/fp4 would be great, too!
lifthrasiir 9/12/2025|
There are too many fp8/fp4 formats out there, many with different trade-offs. At least fp16 is standardized...
elvircrn 9/12/2025||
Yes, all of them would be great.
lifthrasiir 9/13/2025||
Hmm, you successfully nerd-sniped me. AFAIK there are at least:

- 8-bit floating point types: (S1)E4M3 (finite only, has no-negative-zero variant), (S1)E5M2 (has no-negative-zero variant), E8M0

- 6-bit floating point types: (S1)E2M3, (S1)E3M2

- 4-bit floating point types: (S1)E2M1, NF4

- Block floating point types: MXFP8 (E5M2/E4M3*32+E8M0), MXFP6 (E3M2/E2M3*32+E8M0), MXFP4 (E2M1*32+E8M0), NXFP [1]

[1] https://arxiv.org/pdf/2412.19821

Do you have anything to add on?

elvircrn 9/13/2025||
Nothing to add, I was simply saying that it would be useful to have an FP8 toy website out there covering all of these formats.
makeworld 9/12/2025|
See also https://integer.exposed/
jcalx 9/12/2025||
Can't wait for someone to buy boolean.exposed and teach me about some esoteric representation of booleans in memory that I'd never considered (either that or it's a very simple page).
aarestad 9/12/2025||
...authored by [Julia Evans](https://jvns.ca) of tech-explainer fame :)
More comments...