I don't understand how M * 2^E (modulo small representation details) is difficult to grasp. Then you have decimal types as M * 10^E. It's certainly much clearer than the windowing and bucketing in this article.
Floating point visually explained (2017)
11–20 of 58 posts
Re: Floating point visually explained (2017)
#12I don't understand how M * 2^E (modulo small representation details) is difficult to grasp. Then you have decimal types as M * 10^E. It's certainly much clearer than the windowing and bucketing in this article.
His approach works well for me. I don't retain arbitrary facts. At least part of this is a fear that if I don't properly understand its dynamics I will misapply it, better to discard it. The windowing explanation shows me a path from the intent of the designer through to the implementation (the algorithm). Now I can retain that knowledge.
I still fail to understand what is arbitrary in scientific notation. The designers almost certainly didn't think in terms of windows when creating the data types, they probably thought about the mantissa and exponent the way it's usually explained, and maybe about information density (entropy per bit) when comparing with other possibilities.
Anyway, if it helps, great. Different explanations are always welcome. But this one is post-fact.
Re: Floating point visually explained (2017)
#13Why is there no float type with linear precision?
that's called fixed point. there isn't hardware for it because it is cheap to make in software using integer math.
Or is that something you can do with integers and SIMD today?
Say 4x4 matrix multiplication?
Re: Floating point visually explained (2017)
#14Re: Floating point visually explained (2017)
#15Earlier quoted context omitted.
that's called fixed point. there isn't hardware for it because it is cheap to make in software using integer math.
But wouldn't it be sweet to have SIMD acceleration for fixed point? Or is that something you can do with integers and SIMD today? Say 4x4 matrix multiplication?
Re: Floating point visually explained (2017)
#16Earlier quoted context omitted.
that's called fixed point. there isn't hardware for it because it is cheap to make in software using integer math.
But wouldn't it be sweet to have SIMD acceleration for fixed point? Or is that something you can do with integers and SIMD today? Say 4x4 matrix multiplication?
Re: Floating point visually explained (2017)
#17https://dennisforbes.ca/articles/understanding-floating-poin...
At the time it was to educate a group I was working with about why their concern that "every number in JavaScript is a double" doesn't mean that 1 is actually 1.000000001 (e.g. everyone knows that floating point numbers are potentially approximations, so there is a widespread belief that every integer so represented is the same).
Re: Floating point visually explained (2017)
#18Re: Floating point visually explained (2017)
#19One thing I dislike in discussions about floats is this incessant focus on the binary representation. The representation is NOT the essence of the number. Sure it matters if you are a hardware guy, or need to work with serialized floats, or some NaN-boxing trickery, but you can get a perfectly good understanding of binary floats by playing around with the key parameters of a floating point number system:
- precision = how many bits you have available
- exponent range = lower/upper bounds for exponent
- radix = 2 for binary floats
Consider listing out all possible floats given precision=3, exponents from -1 to 1, radix=2. See what happens when you have a real number that needs more than 3 bits of precision. What is the maximum rounding error using different rounding strategies? Then move on to subnormals and see how that adds a can of worms to underflow scenarios that you don't see in digital integer arithmetic. For anyone interested in a short book covering all this, I would recommend "Numerical Computing with IEEE Floating Point Arithmetic" by Overton [1].
Re: Floating point visually explained (2017)
#20While I always new about
0.1 + 0.2 -> 0.30000000000000004
it was still kind of an epiphany realizing that floating point numbers don’t so much have rounding errors as they are simply discreet numbers.You can move from one float to the next, which is a meaningfull operation on discreet numbers like integers, but not continuous numbers like rational and irrational numbers.
I also feel like that is a much more important take away from a user of floating points knowing what the mantissa is.