3 ms·
IMO, it is just as good as Java and c, but rust people will say rust is better than both. But the standard is COBOL, for business applications you need predict
by jmclnx 2y ago
IMO, it is just as good as Java and c, but rust people will say rust is better than both.
But the standard is COBOL, for business applications you need predictable fixed point math. By that, if you divide 1/3 you get .33 instead of .33333333333333333, depending on how the numeric item is formatted. Or maybe a better example, 1/6 you would get .17 instead of .166666666
Does rust have that ability ? I do not know. Some bolt on libraries exist for c, but it is a bit harder to use IIRC.
- PaulHoule 2y agoJava has BigDecimal. This looks pretty nice https://docs.rs/rust_decimal/latest/rust_decimal/ https://docs.rs/rust_decimal/latest/rust_decimal/
- osigurdson 2y ago>> 1/3 you get .33 I have never seen any COBOL code but I'm surprised this works in a general sense even for currency related calculations due to the loss of accuracy. In any case, it seems that it would be relatively easy to implement COBOL compatible numeric processing in any language in a library (and maybe one case where operator overloading is a feature instead of a bug).
- triknomeister 2y agoIt's trivial (in the mathematical sense) to have this ability in Rust.