Inaccuracy in very large float values

Floating-point numbers are necessary for representing fractional numbers, and they're useful for numbers that might range from very small (e.g., 0.000396) to very large, but it's important to bear in mind that they can't possibly represent every possible real number. So there are certain situations in which they misrepresent values. In most cases, that error is so small that it's negligible for real-world musical purposes, but in rare cases it might actually be noticeable, so it's worth at least being aware that floating-point arithmetic does have its inherent problems. This patch shows one such example, in which it misrepresents an extremely large number slightly, and if that number is then converted back to an int it will be grossly misrepresented.

Chapter: 
Keywords: