TRAILZ — Number of trailing zero bits of an integer¶
- TRAILZ()¶
TRAILZ
returns the number of trailing zero bits of an integer.- Parameters
I – Shall be of type
INTEGER
.- Returns
The type of the return value is the default
INTEGER
. If all the bits ofI
are zero, the result value isBIT_SIZE(I)
.
Standard:
Fortran 2008 and later
Class:
Elemental function
Syntax:
RESULT = TRAILZ(I)
Example:
PROGRAM test_trailz WRITE (*,*) TRAILZ(8) ! prints 3 END PROGRAM
See also:
BIT_SIZE, LEADZ, POPPAR, POPCNT