SATURDAY, SEPTEMBER 5, 2026
cobol
Cobol rounding modes are repaired.
Fixes incorrect rounding in COBOL arithmetic operations.
COBOL supports eight rounding modes for arithmetic operations. Recent testing revealed errors in these modes, which this commit corrects. The rounding routine has been moved from libgcobol.cc to gmath.cc to improve organization.
In Details
The __gg__int128_to_int128_rounded function, responsible for COBOL's rounding modes, was moved from libgcobol.cc to gmath.cc. This change aims to consolidate math-related routines and fix subtle rounding errors that were exposed by expanded testing, ensuring adherence to COBOL standards.
For Context
- rounding modes
- Rules that determine how to represent a number when it has more digits than can be stored in the target data type. COBOL defines specific modes for arithmetic operations.