Constants

Constants

String constants contain a sequence of characters within double-quotes, e.g., "this is a string".

Numeric constants include integer constants and floating point constants. An integer constant can be either a decimal constant, an octal constant, or a hexadecimal constant. The digits of an integer constant cannot be separated by white-space characters.

An integer constant can be in one of the following forms:

• A decimal constant is one or more decimal digits, the first of which is not a zero (for example, 13, 130, 3489, 16125).

• An octal constant is a zero followed by one or more octal digits. The leading zero is required to differentiate an octal constant from a decimal constant (for example, 015, 0202, 05541, 037375).

• A hexadecimal constant is either 0x or 0X followed by one or more hexadecimal digits. The leading zero and x (or X) are required (for example, 0xd, 0X82, 0xDa1, 0X3EFD).

If you want to specify a negative integer in DPL, place a minus sign (-) in front of an integer constant.

A floating point constant in DPL is a real decimal number: one that can have non-integer values. None of the digits or characters representing a floating point constant can be separated by white-space characters (for example, 9.8696, 0.31831, 1E-10, 3.14159e0, .25E+6).

If you want to specify a negative floating point number, place a minus sign (-) in front of a floating point constant.

The following are examples of expressions containing numeric constants. These expressions all represent the same number:

• 27
• 033
• 0x6C/4
• 2*1.35E1
• 2*11.0 + 5

Versions: DPL Professional, DPL Enterprise, DPL Portfolio