Hi Anonymous. Please consider to register/login; and if you don't do that wait for post-moderation (that's a manual thing!) before posting again.
Concerning the content (I've did some minor mod-editing for syntax-highlighting) - cob_addsub_optimized(), which is called internally by cob_add() and sub_sub(), calls cob_add_bcd() which handles ROUNDING in general.
I'll recheck later, if no one does it before.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for reporting this severe issue, which is now tracked as [bugs:#934] (see this report for more details including possible work-arounds in the COBOL code).
If you build GnuCOBOL from source you could also locally fix that (numeric.c around line 3100), or wait until Chuck provides the fix (likely in the next 32h :-)
Hi
The following program show a bug in the
ADDstatement with theROUNDEDclause. The functioncob_addsub_optimized(numeric.c) does not work.The results are :
Last edit: Simon Sobisch 2024-01-09
Hi Anonymous. Please consider to register/login; and if you don't do that wait for post-moderation (that's a manual thing!) before posting again.
Concerning the content (I've did some minor mod-editing for syntax-highlighting) -
cob_addsub_optimized(), which is called internally bycob_add()andsub_sub(), callscob_add_bcd()which handlesROUNDINGin general.I'll recheck later, if no one does it before.
Thank you for reporting this severe issue, which is now tracked as [bugs:#934] (see this report for more details including possible work-arounds in the COBOL code).
If you build GnuCOBOL from source you could also locally fix that (numeric.c around line 3100), or wait until Chuck provides the fix (likely in the next 32h :-)
Related
Bugs:
#934Hello,
the fix for this issue has been coded and tested. I expect that Simon will include it in the upcoming 3.3 release
F:\AA-minGW32-static>testbug-001
add rounded fail
ADD RESULT-5 TO RESULT ROUNDED.
RESULT-5 +0000000000003,14659
RESULT +0000000000003,15
ps... note that the 3.3 fixes also include a fix for the missing decimal point character in the DISPLAY output.
Chuck Haatvedt
Sorry, I have auto logon set but for some reason, I was not logged in and did not notice that when I responded above.