Language Reference


INT Function

INT (matrix);

The INT function truncates the decimal portion of the value of the argument. The integer portion of the value of the argument remains. The INT function takes the integer value of each element of the argument matrix, as shown in the following statements:

y = 2.8;
b = int(y);
x={12.95  10.9999999999999,
   -30.5  1e-6};
c = int(x);
print b, c;

Figure 24.169: Truncated Values

b
2

c
12 11
-30 0



In FigureĀ 24.169, notice that the value 11 is returned as the second element of c. If a value is within $10^{-12}$ of an integer, the INT function rounds up.