Floating-point Numbers

This COBOL system provides IEEE floating-point support. This is fully compatible with the various languages supplied by Microsoft, including Microsoft Visual C++ V6.0.

Floating-point values must be in the range:

For COMP-1 data, 8.43E-37 through 3.37E38
  -8.43E-37 through -3.37E38
For COMP-2 data, 4.19E-307 through 1.67E308
  -4.19E-307 through -1.67E308

Note that although the above ranges are supported internally, this COBOL system supports only 2 digit exponents, and the range is effectively:

For COMP-2 data, 4.19E-99 through 1.67E99
  -4.19E-99 through -1.67E99

The accuracy of floating-point values is:

For COMP-1 data (4 bytes) 6-7 significant digits
For COMP-2 data (8 bytes) 15-16 significant digits
For literals, floating-point values must be in the range:
  • 0.54E-78 through 0.72E+76
  • -0.54E-78 through -0.72E+76