Please enable JavaScript to view this site.

Written August 2020

SIGNIFICANCE digits

This statement establishes the maximum number of significant digits to be displayed when printing floating point values (without a USING mask) to the screen or a file . digits is an integer, the default is 6. If the value being printed requires more than the specified number of digits for the integer part of the value, exponential notation will be used instead. Digits to the right of the decimal point that exceed the significance value will be rounded off.

Example

MAP1 VALUE,F,8,12345678.98765

 

? "Default Significance (6): ";VALUE    ! 1.23456e+07

 

SIGNIFICANCE 10

? "Significance 10 ";VALUE              ! 12345678.99

 

SIGNIFICANCE 12

? "Significance 12 ";VALUE              ! 12345678.98765

 

SIGNIFICANCE 16

? "Significance 16 ";VALUE              ! 12345678.98765564

 

Notes

The last example above illustrates the problem of the inherent limitations of binary floating point representation for decimal fractional values, resulting in unwanted extra digits beyond those contained in the original value. When the SIGNIFICANCE limit exceeds the number of digits in the original value, these rounding errors (in the conversion from binary to decimal fractions) will show up. The best way to avoid that problem is to rely on USING masks when displaying fractional values like currency amounts.

Note that SIGNIFICANCE only affects the display formatting of numeric values; it does not affect the internal precision of calculations. Nowadays, the standard internal precision is 64 bit (approximately 16 decimal digits), but in order to maintain compatibility with the original 48 bit floating point hardware, from whence the F,6 variable type arose, most intermediate calculations are down-scaled to 48 bit precision. So even when using F,8 variables, you may not be experiencing the full effect of 64 bit precision from end to end.

See Also:

Created with Help+Manual 9 and styled with Premium Pack Version 5 © by EC Software