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 23.146: Truncated Values

b
2

c
12 11
-30 0


In Figure 23.146, 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.