4 ms·
My position for ages now has been that it was a mistake to make floating point types first-class primitives in most programming languages. Integers and rational
by quotemstr 5y ago
My position for ages now has been that it was a mistake to make floating point types first-class primitives in most programming languages. Integers and rationals should be the go-to types for most code most of the time. If you really need a IEEE float, you should reach into a library to get it.
- rightbyte 5y agoI think you mixed up the problem. Had they used floats they would have got a small rounding error, not a 23 million loss.
- kevinpet 5y agoWell, this isn't very strong support for that position, because Ethereum doesn't support floating point, and yet here we are.
- jonny_eh 5y ago> Ethereum doesn't support floating point The software that interacts with it does.
- mhh__ 5y agoSo all companies will automatically include the float library and thus nothing will change
- WillDaSilva 5y agoWhat you include as a first-class element in your languages, versus what is packed away in a library, will affect what developers do with your language. For instance, Numpy provides array-language [1] capabilities to Python, but because it isn't a first-class element in the language Python is not thought of as an array language, and using it as one would be a bit clunky. [1] https://en.wikipedia.org/wiki/Array_programming https://en.wikipedia.org/wiki/Array_programming
- MuffinFlavored 5y agoDumb question on my end, I apologize. How are rationals used to represent decimals?
- dragonwriter 5y ago> How are rationals used to represent decimals? Decimals are just the subset of rationals where the denominator is always a power of 10, so the representation and arithmetic operations are simple if you already have rational support (though if you need to preserve decimal results, you need approximation logic for division, since dividing two rationals with denominators that are powers of 10 may result in a rational with a denominator that is not a power of 10.)
- thaumasiotes 5y ago> though if you need to preserve decimal results, you need approximation logic for division, since dividing two rationals with denominators that are powers of 10 may result in a rational with a denominator that is not a power of 10. This is also true for adding, subtracting, and multiplying, though in those cases it is always trivial to convert the result into a form where the denominator is a power of 10.
- webkike 5y agoIf the only thing you use computers for is processing financial transactions then that position is defendable
- abraae 5y agoAny number of sensors, measuring devices and other IoT stuff disagrees with you.