Difference between floating and fixed point
Alvaro Pa?ó
Software Architect & Tech Leader | Crafting High-Performance, Cloud-Native Systems | 10+ Years in Full-Stack Development | IDCiber Consul Member
You know what's the difference between this two type of variables: floating point and fixed point?
I'll try explain the most shortly and easily that i can.
The most important difference is the precision. The floating type is too much more imprecise than the fixed point. With fixed point you can set the length of the decimal part and the fractional parts.
In the floating point the size is variable depending on the machine architecture. A floating number is calculating as value * 2 ^ -mantisa. So, when we have application that's work with a lot of arithmetic operations, the results can change depending on the Operational System.
For this reason is not recommended use floating points in financial operations, for example.
So, this is a short explain.
Enjoy!