Determines the number of digits used when comparing numbers.

Syntax

SET PRECISION TO [<expN>]

<expN>

The number of digits, from 10 to 34. The default is 10.

Description

Use SET PRECISION to change the accuracy, or precision, of numeric comparisons. You can set precision from 10 to 34 digits.

You can temporarily SET PRECISION by using the SET PRECISION TO <nInt>

Or you can permanently SET PRECISION by going to the menu item ... Properties | Desktop Properties 'Programming' tab and setting 'Precision' under 'Command Output'

SET PRECISION affects data comparisons and in some cases data display but, not mathematical computations. Math computations always use full precision internally. To change the number of decimal places dBASE Plus displays, use SET DECIMALS.

In general, you should use as little precision as possible for comparisons. Like many programs, many dBASE Plus numbers are handled as base-2 floating point numbers. This format can precisely represent some values (for example: fractional values such as 0.5 (1/2) or 0.375 (3/8)). but cannot precisely represent other values such as 1/3 (0.333333...), 2/3 (0.66666...).

Beginning with dBASE Plus 8.0 dBASE supports the use of High Precision numbers with up to 34 digits of precision. See topic:  (High Precision Math)

for more information.

Examples: (in the COMMAND Window)

? 301.840002 - 301.000001

? 123456789.012345 * 87654321.123456789

OUTPUT:

0.840001

10821521028958940.344459595060205