On this page
8.143 LEADZ — Number of leading zero bits of an integer
- Description:
LEADZreturns the number of leading zero bits of an integer.- Standard:
- Fortran 2008 and later
- Class:
- Elemental function
- Syntax:
RESULT = LEADZ(I)- Arguments:
-
I Shall be of type INTEGER. - Return value:
-
The type of the return value is the default
INTEGER. If all the bits ofIare zero, the result value isBIT_SIZE(I). - Example:
-
PROGRAM test_leadz WRITE (*,*) BIT_SIZE(1) ! prints 32 WRITE (*,*) LEADZ(1) ! prints 31 END PROGRAM - See also:
- BIT_SIZE, TRAILZ, POPCNT, POPPAR
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gfortran/LEADZ.html