REAL_TO_DINT Function

REAL_TO_DINT(a)

Converts a to a DINT by rounding to the nearest integer.

Parameters

a(REAL)

The value to convert to a DINT.

Return Value

Returns a DINT.

Remarks

0.5 rounds up to 1.

Rounding -0.5 differs between the RMCs:

Examples

REAL_TO_DINT(0.5) returns 1

REAL_TO_DINT(-7.89) returns -8

 

See Also

TRUNC Function | DINT_TO_REAL Function | DINT_TO_DWORD Function | DWORD_TO_DINT Function | Standard Functions


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion