LTRUNC

LTRUNC 1:

The LTRUNC function determines the integral component of a floating point number.

Examples

LTRUNC(2.8) = 2

LTRUNC(-2.8) = -2

Similar functions: TRUNC, FLOOR

LTRUNC 2:

Unlike TRUNC, the result from LTRUNC is of type LREAL and is therefore not limited to the value range of integer variables.

FUNCTION LTRUNC : LREAL

LTRUNC 3: Inputs

VAR_INPUT
    lr_in : LREAL;
END_VAR

Name

Type

Description

lr_in

LREAL

Function parameters of type LREAL

LTRUNC 4:

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Math