4D v16.3SET REAL COMPARISON LEVEL |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
SET REAL COMPARISON LEVEL
SET REAL COMPARISON LEVEL
The SET REAL COMPARISON LEVEL command sets the epsilon value used by 4D to compare real values and expressions for equality. A computer always performs approximative real computations; therefore, testing real numbers for equality should take this approximation into account. 4D does this when comparing real numbers by testing whether or not the difference between the two numbers exceeds a certain value. This value is called the epsilon and works this way: Given two real numbers a and b, if Abs(a-b) is greater than the epsilon, the numbers are considered not equal; otherwise, the numbers are considered equal. By default, 4D, sets the epsilon value to 10 power minus 6 (10^-6). Please note that the epsilon value should always be positive. Examples:
Using SET REAL COMPARISON LEVEL, you can increase or decrease the epsilon value as you require. WARNING: Typically, you will not need to use this command to change the default epsilon value. IMPORTANT: Changing the epsilon only affects real comparison for equality. It has no effect on other real computations nor on the display of real values. Note: The SET REAL COMPARISON LEVEL command has no effect on queries and sorts performed with fields of the Real type. It only applies the 4D language.
See also
|
PROPERTIES
Product: 4D
HISTORY
Created: 4D v6 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||