Numerical operation including decimal point in WinC function
search cancel

Numerical operation including decimal point in WinC function

book

Article ID: 115953

calendar_today

Updated On:

Products

CA Plex

Issue/Introduction

The calculation result of the numerical value including the decimal point does not become the correct value in the WinC function.

Environment

CA Plex 7.2.1 and higher

Cause

When calculating in action diagram using fixed decimal numbers in C ++, values are correct unless intermediate value (in case of composite calculation) or result value overflow (overflowed) after being once passed to fixed decimal type. However, if have received a value from a Double or Float type and have a decimal value at that point, since it is already an approximation, the calculation result will not be correct.

Resolution

Use the assignment operator "ROUND =" instead of operator "=" when performing calculations involving numerical values that have the decimal point .