5 ms·
Floating Point Visually Explained (2017)
- mekane8 8y agoThis is an awesome explanation, thanks for sharing! I remember struggling mightily in college to understand Floating Point, and my professor never offered anything other than the mathematical formula explanation. That never really helped me understand how the computer is actually dealing with these numbers, but this step-by-step explanation really clicked.
- dang 8y agoDiscussed at the time: https://news.ycombinator.com/item?id=15359574 https://news.ycombinator.com/item?id=15359574
- svat 8y agoSee also: * https://float.exposed/ https://float.exposed/ (companion blog post: https://ciechanow.ski/exposing-floating-point/ https://ciechanow.ski/exposing-floating-point/) * http://www.toves.org/books/float/ http://www.toves.org/books/float/ (Reproducing from another discussion a month ago: https://news.ycombinator.com/item?id=18832155 https://news.ycombinator.com/item?id=18832155)
- userbinator 8y agoOne of my favourite sites for explaining floating-point, especially the more subtle aspects, is https://www.exploringbinary.com/ https://www.exploringbinary.com/ . Here's a similar article from that site: https://www.exploringbinary.com/the-spacing-of-binary-floating-point-numbers/ https://www.exploringbinary.com/the-spacing-of-binary-floati...
- mark-r 8y agoIntel's floating point coprocessor may have been out of reach for most people in the early 90's, but there were clones available. My 386 had a Cyrix I believe.
- canada_dry 8y ago> My 386 had a Cyrix I believe. Yup... and as I recall, it was a must have for MS flight sim and Falcon 3!
- rasz 8y agonope, ms sim didnt use fpu, falcon 3 had a separate, optional "realistic" hi-fidelity flight model that used fpu, but it was pretty broken http://simhq.com/forum/ubbthreads.php/topics/3803136/re-falcon-3-0-joystick-sensitivity-problem-in-hi-fidelity-flight-model#Post3803136 http://simhq.com/forum/ubbthreads.php/topics/3803136/re-falc...
- hopler 8y agoI don't understand how the pictures help. The core formula is compact, but that doesn't make it bad. A few sentences of explanation is great for people who haven't learned standard high-school-level math notation or who want a walkthrough as a refresher (so thanks tonthr author for writing it down ), but refusing to learn math notation is going to make learning every math concept harder, penny wise and pound foolish. I don't see how this blog post/book chapter's explanation is novel as it claims to be, or why every other explanation of floating point is supposedly poor. I suspect it's just a matter of learning concepts requires thinking, so thrilled author jotted notes while he was thinking, and misattributed his progress to the specific visuals and no to the process of thinking about the formula. The hard part of floating point isn't the representation of numbers, it's how to perform arithmetic with rounding/truncation in the specified way (and why the specified way is preferred). The blog post doesn't touch on that at all.
- _jsdw 8y agoPersonally, I might be able to convert a number to floating point using the formula, but it's not easy to grasp why. The visual explanation really helps with that. Being able to read maths doesn't automatically mean that it is the best way to present an explanation of something.
- jankins 8y agoAny mathematical instruction I have found helpful has had a big emphasis on building “intuition“. This post was the first explanation I encountered that explained floating point encoding in a way that was immediately relatable and understandable to me. There are multiple ways to describe a thing, different people have different relationships to a thing which may make some descriptions more well-suited than others, and different people have different goals.
- sephoric 8y agoMy son and I have been trying to understand floating point numbers with almost no success, since it's usually explained with arcane mathematical symbols that neither of us understand. This page is brilliant and I'm going to show this to him, after editing the hilarious image with the owl. Why is profanity necessary to convey intensity? It's 2019, surely we have better ways of doing so by now.
- velp 8y agoSerious question - why get so bothered by it? If he's old enough to be thinking about floating point numbers, he's definitely heard the word, and it's not especially gratuitous in this instance. Might be a good opportunity to discuss how word choice is dependent on context.
- jake_the_third 8y ago> Serious question - why get so bothered by it? Same reason why many people refuse to visit nude beaches despite others not seeing any issue in said these beaches: personal values and principles.
- dahart 8y ago> Why is profanity necessary to convey intensity? It's not necessary, it's just funny. The owl picture is a meme borrowed from the internet to make the same point you did ... that it feels like math notation skips over the how. FWIW, spending time in a floating point calculator can be very enlightening. I use this page all the time https://www.h-schmidt.net/FloatConverter/IEEE754.html https://www.h-schmidt.net/FloatConverter/IEEE754.html A great exercise to try with your son: try numbers of various magnitudes and see what a 1-bit change does to the decimal value. For example, try the earth's radius in meters and determine the FP32 precision in meters at the surface of the earth.
- swebs 8y agoThe owl photo has been going around the internet for at least 15 years now.
- Allower 8y ago>Once you have reached the maximum in a window (e.g [2,4]), you can "float" it right and represent the number within the next window (e.g [4,8]). It only costs a little bit of precision since the window becomes twice as large. WTF is that supposed to mean?
- jstanley 8y agoI think this explanation still makes it harder than it needs to be. Just imagine what a "floating point" number would mean in decimal: you get (say) 5 adjacent digits to play with, and you get to choose where you put the decimal place, within a limited range. So you can represent 12345000 or 12.345 or 0.00012345. But 12345600 rounds to 12346000, 12.3456 rounds to 12.346, and 0.000123456 rounds to 0.00012346.
- joe4322353 8y agoSome might be mistaken this post is from fabrice bellard just like me, it it not. The web address might be a little bit confusing. This is not a post by fabrice bellard the guy who initiated ffmpeg project among many others.