Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Numeric literals

A numeric literal is a character-string whose characters are selected from the digits 0 through 9, a sign character (+ or -), and the decimal point. If the literal contains no decimal point, it is an integer. (In this documentation, the word integer appearing in a format represents a numeric literal of nonzero value that contains no sign and no decimal point, except when other rules are included with the description of the format.) The following rules apply:

The value of a numeric literal is the algebraic quantity expressed by the characters in the literal. The size of a numeric literal is equal to the number of digits specified by the user.

Numeric literals can be fixed-point or floating-point numbers.

Rules for floating-point literal values

The format and rules for floating-point literals are listed below.

Format
Read syntax diagramSkip visual syntax diagram>>-+-----+--mantissa E--+-----+--exponent----------------------><
   +- + -+              +- + -+            
   '- - -'              '- - -'            
 

Numeric literals are in the numeric data class and category. (Data classes and categories are described under Classes and categories of data.)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)