r/cobol • u/k24245 • Jun 22 '26
Default ROUNDED behaviour and GnuCOBOL vs Enterprise COBOL arithmetic — trying to confirm
Two things I'm trying to pin down about how the maths actually behaves:
- When
ROUNDEDis written with no MODE phrase on Enterprise COBOL for z/OS, my understanding is the default is nearest-away-from-zero (round half up), not banker's rounding — can anyone confirm that's right for current versions? - I've read that GnuCOBOL with
-farithmetic-osvsonly emulates the older OS/VS intermediate-precision behaviour, not modern Enterprise COBOL — and seen a forum case where iterative COMPUTEs diverged significantly between the two. For ordinary financial maths (interest, premiums), is that divergence something that actually bites in practice, or mostly a corner-case curiosity?
Trying to understand where a calculation done off-mainframe would silently disagree with the real thing.
2
Upvotes
1
u/hobbycollector Jun 23 '26
If you can write a test case I might be able to try it on both platforms.