<Example Program>

Program leadz_example
    Integer,Parameter :: i8 = Selected_Int_Kind(2)
    Integer(i8) :: a(3) = [ Int(z'f1',i8),Int(z'7a',i8),Int(z'0f',i8) ]
    Print *,
Leadz(a)
End Program

Execution Results

  0 1 4