Data type Numeric Foundation

The data type "numeric" identifies values that can be used in executing mathematical operations. Literal numeric values are identified in a program by the digits 0 to 9, with an optional signed prefix and an optional decimal point. They have no other delimiting characters. When a numeric literal is enclosed using the delimiting characters for character strings, the result is a character string and not a numeric value. As an alternative, numeric literals can be programmed using hexadecimal or scientific notation. The following lines show valid numeric constants:

 100          // decimal 
 3.1415926 
+200 
-.12345 

0xFF          // hexadecimal 
0x0A 

10.1E-10      // sientific 
 0.13e-2 

Numeric values are handled within Xbase++ in the IEEE 64 bit format for floating point numbers. This provides a range for calculations of 10 to the power of -307 to 10 to a power of +308. The binary representation of a floating point number yields a 16 decimal digit precision.

The display of numeric values on the screen is predictable only up to 16 places before the decimal and 15 places after the decimal. Numeric values are displayed with a maximum of 31 digits. If there are more pre or post decimal numerals, asterisks * or nulls 0 are shown in the display of the number.

When a numeric value is stored in a field variable (DBF file), translation of the value occurs to a format which can be displayed. For this reason numeric values in field variables in a DBF file are stored with a maximum precision of 16 places before and 15 places after the decimal.

If the display format for numeric values is not explicitly specified, display of a decimal point or comma depends on the country setting of the system configuration.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.