TRUNC

Truncates a real value to have just the integer part.
lrsf_tr1
Arguments
IN
IN
REAL
Any REAL value
TRUNC
Q
REAL
If IN>0, biggest integer less or equal to the input
If IN<0, least integer greater or equal to the input
Example
(* FBD Program using "TRUNC" Function *)
lrsf_tr2
(* ST Equivalence: *)
result := TRUNC (+2.67) + TRUNC (-2.0891); (* means: result := 2.0 + (-2.0) := 0.0; *)
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal