Page 1 of 1

COMP vs COMP‑3 arithmetic surprises

Posted: Sat Oct 11, 2025 2:59 pm
by Aakash Kochar
Seeing different rounding/precision between COMP and COMP‑3. How do you choose types to avoid bugs? Thanks in advance for sharing your thoughts.

Re: COMP vs COMP‑3 arithmetic surprises

Posted: Sat Oct 11, 2025 4:43 pm
by enrico-sorichetti
read the manual and/or search for "differences between COBOL COMP COMP3"

hint ...
COMP binary numbers
COMP3 packed decimal numbers

topic moved where it belongs ... the COBOL and friends section