Floats tend to be overused by programmers. Almost every real-world quantity (time, money, sensor readings...) is actually quantized, and is better represented via integers (ms, cents, etc.) The only real use case of floats is scientific computing (physics, ML, simulations...)
-
-
I have to use floats in sales tax calculations sometimes. If you try calculating without it the number don't equal a 100%. It's so annoying. Happens with many finance calculations. But you are quite correct. Its a over used type but we programmers are lazy.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
yeah, but you can check equality between floats by checking if the absolute value of their difference is less than epsilon( say £) where epsilon tends to 0.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Meanwhile, cryptocurrencies…
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Do you know that Excel numbers are even less precise than float? And that it is used by many accountants and consultants etc.https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Assuming the problem is ML, how much error is actually introduced by using float? It'd be good to have at least some examples of the errors that come from this.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.