5 ms·
Some scientific and accounting software require it. Python has a decimal data type [1]. [1]: https://docs.python.org/3/library/decimal.html https://docs.python
by ciupicri 11y ago
Some scientific and accounting software require it. Python has a decimal data type [1].
[1]: https://docs.python.org/3/library/decimal.html https://docs.python.org/3/library/decimal.html
- AnimalMuppet 11y agoSure. But that doesn't make it "key" in the sense that, say, lists and maps are.
- dragonwriter 11y ago> Sure. But that doesn't make it "key" in the sense that, say, lists and maps are. No, its more like "key" in the way that ints are. Well, not quite -- less than ints, but more than floats.
- AnimalMuppet 11y agoYou think that, across computing in general, decimal data types are used more than floats are? I am extremely skeptical. (Or do you have data?)
- dragonwriter 11y agoNo, I'm not saying they are used more often, but they are more important in major application domains. Floats are used more often, but often not because they are domain-appropriate, often as a premature optimization, or as a matter of developer convenience because many major tools (languages and libraries) make float use more convenient. Exact rationals are in a similar situation.
- kazinator 11y agoDecimals have a limited application. They basically just pander to the need to have the machine conform to some hokey pencil-and-paper arithmetic rules remotely linked to the number of fingers on two hands.