kind - (Optional) An integer initialization expression indicating the kind parameter of the result.

Return value

These functions return a integer variable or array under the following rules:

If a is of type integer, int(a) = a

If a is of type real and $\mid a\mid <1$, int(a) equals 0. If $\mid a\mid \ge 1$, then int(a) equals the largest integer that does not exceed the range of a and whose sign is the same as the sign of a.

If a is of type complex, rule 2 is applied to the real part of a.

Example

program test_intinteger::i=42complex::z=(-3.7,1.0)print*,int(i)print*,int(z),int(z,8)endprogram