TRAILZ returns the number of trailing zero bits of an integer.
Fortran 2008 and later
Elemental function
RESULT = TRAILZ(I)
| I | Shall be of type INTEGER. |
The type of the return value is the default INTEGER. If all the bits of I are zero, the result value is BIT_SIZE(I).
PROGRAM test_trailz WRITE (*,*) TRAILZ(8) ! prints 3 END PROGRAM
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gfortran/TRAILZ.html