This pull request modifies the CobolNumericField to fix subtract statements against PIC 9 variables. The most important changes include the addition of a method to check for positive or negative zero, an adjustment in the subtraction logic, and the inclusion of new test cases.
Enhancements to CobolNumericField class:
Modified displaySubInt method to adjust the byte value if it is greater than or equal to 0x70. (libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java)
Added isPositiveZeroOrNegativeZero method to check if the field is either positive or negative zero, and updated addInt method to use this check. (libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java)
Additions to test cases:
Created fix-subtract.at to test various subtraction scenarios in COBOL programs. (tests/misc.src/fix-subtract.at)
This pull request modifies the
CobolNumericField
to fix subtract statements against PIC 9 variables. The most important changes include the addition of a method to check for positive or negative zero, an adjustment in the subtraction logic, and the inclusion of new test cases.Enhancements to
CobolNumericField
class:displaySubInt
method to adjust the byte value if it is greater than or equal to0x70
. (libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java
)isPositiveZeroOrNegativeZero
method to check if the field is either positive or negative zero, and updatedaddInt
method to use this check. (libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/data/CobolNumericField.java
)Additions to test cases:
fix-subtract.at
to test various subtraction scenarios in COBOL programs. (tests/misc.src/fix-subtract.at
)