▲ | AtlasBarfed 2 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The core thing to know about floating point numbers in comp langs is they aren't floating point numbers. They are approximations of floating point numbers, and even if your current approximation of a floating point number to represent a value seems to be accurate as an integer vale... There is no guarantee if you take two of those floating point number approximations that appear completely accurate that the resulting operation between them will also be completely accurate. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | kccqzy 2 days ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
That's not a useful way to think. Floating point numbers are just floating point numbers. You aren't approximating floating point numbers. You are approximating real numbers. Floating point numbers are compared against fixed point numbers where the point (the part between the integer part and fractional part) is fixed. That is why they are called floating. The nature of the real numbers is such that they can in general only be approximated, regardless of whether you use fixed point numbers or floating point numbers or a fancier computable number representation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|