[UP]


Manual Reference Pages  - leadz (3)

NAME

leadz(3f) - [FORTRAN:INTRINSIC:BIT INQUIRY] Number of leading zero bits of an integer

CONTENTS

Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also

SYNTAX

result = leadz(i)

DESCRIPTION

LEADZ returns the number of leading zero bits of an integer.

ARGUMENTS

I - Shall be of type INTEGER.

RETURN VALUE

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).

EXAMPLE

Sample program:

    program demo_leadz
      write (*,*) leadz(1)  ! prints 8 if bitsize(i) has the value 32
    end program demo_leadz

STANDARD

[[Fortran 2008]] and later

CLASS

[[Elemental procedure|Elemental function]]

SEE ALSO

[[bit_size]], [[popcnt]], [[poppar]], [[trailz]]


leadz (3) March 18, 2019
Generated by manServer 1.08 from 9c491d38-d85d-4da2-8394-93f16b34ad72 using man macros.