Gen
Gen - Workstation Toolset
Gen - Host Encyclopedia
Gen - Run Time Distributed

Some Gen calculations with decimal numbers can produce inaccurate results. What can cause this?

Release: KGNDDL99000-8.5-Gen-DBP Developer License

Component:

Component:

Any time a floating-point data type (float or double) is used, the possibility of a loss of precision exists because of the way floating-point numbers are stored. A loss of precision is possible even if there is no mathematical operation on the floating-point data types, i.e. just storing a number in a floating-point data type can be enough for a loss of precision to occur.

Gen generates floating-point data types in either of the following cases:

- An attribute is defined with decimals
- An attribute has length greater than 9 digits.

Therefore to ensure numeric accuracy, it is recommended to turn on the Decimal Precision property for any numeric attribute that meets either of the following two conditions:

- Number of decimal places > 0
- Length of attribute is > 9 (even if number of decimal places = 0)

Examples:

If an attribute is declared with a length of 8 and with 2 decimal places (8,2), that meets condition 1 above, so Decimal Precision should be checked.

If an attribute is declared as a 10 digit integer (10,0), that meets condition 2 above, so Decimal Precision should be checked.

In addition calculations should be set to ROUNDED to ensure no loss of accuracy.

Yes

No