Skip to content

Commit 44c92e9

Browse files
fix: some functions for mathematics
1 parent 950b59a commit 44c92e9

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolNumericDoubleField.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@ public CobolNumericField getNumericField() {
149149
CobolFieldAttribute attr =
150150
new CobolFieldAttribute(
151151
CobolFieldAttribute.COB_TYPE_NUMERIC_DISPLAY,
152-
24,
153-
12,
152+
40,
153+
20,
154154
CobolFieldAttribute.COB_FLAG_HAVE_SIGN,
155155
null);
156-
CobolDataStorage storage = new CobolDataStorage(24);
156+
CobolDataStorage storage = new CobolDataStorage(40);
157157
double dval = Math.abs(this.getBinaryValue());
158-
String dataString = String.format("%024.12f", dval).replace(".", "");
159-
storage.memcpy(dataString, 24);
160-
AbstractCobolField field = CobolFieldFactory.makeCobolField(24, storage, attr);
158+
String dataString = String.format("%041.20f", dval).replace(".", "");
159+
storage.memcpy(dataString, 40);
160+
AbstractCobolField field = CobolFieldFactory.makeCobolField(40, storage, attr);
161161
if (this.getSign() >= 0) {
162162
field.putSign(1);
163163
} else {

tests/run.src/functions.at

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,6 @@ AT_CHECK([java prog], [0],
507507
AT_CLEANUP
508508

509509
AT_SETUP([FUNCTION EXP])
510-
AT_CHECK([${SKIP_TEST}])
511510

512511
AT_DATA([prog.cob], [
513512
IDENTIFICATION DIVISION.
@@ -758,7 +757,6 @@ AT_CHECK([java prog], [0],
758757
AT_CLEANUP
759758

760759
AT_SETUP([FUNCTION LOG])
761-
AT_CHECK([${SKIP_TEST}])
762760

763761
AT_DATA([prog.cob], [
764762
IDENTIFICATION DIVISION.
@@ -788,7 +786,6 @@ AT_CHECK([java prog], [0],
788786
AT_CLEANUP
789787

790788
AT_SETUP([FUNCTION LOG10])
791-
AT_CHECK([${SKIP_TEST}])
792789

793790
AT_DATA([prog.cob], [
794791
IDENTIFICATION DIVISION.
@@ -1355,7 +1352,6 @@ AT_CHECK([java prog], [0],
13551352
AT_CLEANUP
13561353

13571354
AT_SETUP([FUNCTION STANDARD-DEVIATION])
1358-
AT_CHECK([${SKIP_TEST}])
13591355

13601356
AT_DATA([prog.cob], [
13611357
IDENTIFICATION DIVISION.
@@ -1501,7 +1497,6 @@ AT_CHECK([java prog], [0],
15011497
AT_CLEANUP
15021498

15031499
AT_SETUP([FUNCTION TAN])
1504-
AT_CHECK([${SKIP_TEST}])
15051500

15061501
AT_DATA([prog.cob], [
15071502
IDENTIFICATION DIVISION.

0 commit comments

Comments
 (0)