Previous Topic: About Arithmetic in NCL

Next Topic: Real Number Arithmetic

Integer Arithmetic

NCL performs integer arithmetic by default. This means that an expression that contains only integers yields only integers as a result.

The problem with integer arithmetic is that it does not allow you to use decimal calculations to get accurate results. The use of integer arithmetic is controlled by the &CONTROL INTEGER operand.

Example: Integer Arithmetic

The following example yields the answer 2:

10 / 4 (10 divided by 4)