1.5
Precision correction on comparison errors (TRUNC)
1.5
Function
The TRUNC command truncates the operand multiplied by a precision factor.
Settable precision for comparison commands
Program data of type REAL are displayed internally with 64 bits in IEEE format. This display
format can cause decimal numbers to be displayed imprecisely and lead to unexpected
results when compared with the ideally calculated values.
Relative equality
To prevent the imprecision caused by the display format from interfering with program flow,
the comparison commands do not check for absolute equality but for relative equality.
Syntax
Precision correction on comparison errors
TRUNC (R1*1000)
Significance
TRUNC:
Relative quality of 10
● Equality: (==)
● Inequality: (<>)
● Greater than or equal to: (>=)
● Less than or equal to: (<=)
● Greater/less than: (><) with absolute equality
● Greater than: (>)
● Less than: (<)
Job Planning
Programming Manual, 06/2009, 6FC5398-2BP20-0BA0
Truncate decimal places
taken into account for
-12
1.5 Precision correction on comparison errors (TRUNC)
Flexible NC programming
73