Re:GCC optimized code gives strange floating point results
by brucedawson on Monday February 27, 2017 @02:05AM
(#13742438)
Why not? Decimal floats have definite advantages if you are dealing with decimal data, but that is not the only type of data that floats are used for, and it probably isn't the majority. Binary floating point is better than decimal floating point if you don't care about decimal-interop (more precision per bit, more consistent precision), and decimal floating point has all the same issues (except for confusing conversions to decimals).
So, if you are dealing with raw sensor data, neural nets, character models in a game, numerical simulations, and many other types of data, the extra precision of binary floating-point is far more important than any confusion that arises during those (rare) conversions to decimal.
Re:GCC optimized code gives strange floating point results
by beached_whale on Monday February 27, 2017 @07:03PM
(#13749844)
It's all about costs and benefits though. I do think that a decimal type should be standard along side a float so that the most appropriate one can be chosen. But in many contexts, one needs to go outside the immediate ecosystem to third party libraries to get an alternative to floating point. Currency is a good example of a type that should not use floating point arithmetic but is far too often.
Re:GCC optimized code gives strange floating point results
by Gibbon1 on Monday February 27, 2017 @08:15PM
(#13750290)
I think the difference is binary floating point tends to be on massive automatically generated sets of data. And binary floats are mostly perfect for that.
However the bias towards scientific computing is a problem. because there are large numbers of use cases where the inputs and outputs are decimal floats because you're dealing with humans and their preference for base 10.
Because almost no one actually wants wants binary floating point.