Re:GnuCOBOL 3.1.1
by RcouF1uZ4gsC on Friday December 11, 2020 @03:36PM
(#25390632)
One thing I have heard about COBOL is that it has a built in, decimal fixed point type. Very few of the modern languages have an native type like this. Having a decimal fixed point type makes monetary calculations easier to do more reliably.
[ Parent
| on HN ]
Re:GnuCOBOL 3.1.1
by dragonwriter on Friday December 11, 2020 @04:13PM
(#25391066)
> One thing I have heard about COBOL is that it has a built in, decimal fixed point type. Very few of the modern languages have an native type like this..
What modern language doesn’t have either fixed-point or arbitrary-precision decimals (or both) in either the core language or standard library?
I mean, sure, C doesn’t (and I don’t think C++ does), but those aren’t particularly modern languages.
Re:GnuCOBOL 3.1.1
by RcouF1uZ4gsC on Friday December 11, 2020 @04:26PM
(#25391238)
In don’t think that Java fits the bill either in this regard. White it does have BigDecimal in the standard library, it is both slower(because object and supports arbitrary precision) and more cumbersome (no operator overloading ) than a native type.
I can see a case for decimal floating point types, but fixed point adds nothing beyond what can be performed directly via arithmetic on the underlying integers. It's basically a convenience feature.