trailz(3f) - [FORTRAN:INTRINSIC:BIT INQUIRY] Number of trailing zero bits of an integer
Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also
result = trailz(i)
TRAILZ returns the number of trailing zero bits of an integer.
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).
Sample program:
program demo_trailz write (*,*) trailz(8) ! prints 3 end program demo_trailz
[[Fortran 2008]] and later
[[Elemental function]]
[[bit_size]], [[popcnt]], [[poppar]], [[leadz]]
trailz (3) | March 19, 2019 |