BTEST(3f)

DESCRIPTION
BTEST(I,POS) returns logical .TRUE. if the bit at POS in I is set. The counting of the bits starts at 0.

STANDARD
Fortran 95 and later

CLASS
Elemental function

SYNTAX
RESULT = BTEST(I, POS)

ARGUMENTS

I The type shall be INTEGER. POS The type shall be INTEGER.

RETURN VALUE
The return value is of type LOGICAL

EXAMPLE
          program test_btest
              integer :: i = 32768 + 1024 + 64
              integer :: pos
              logical :: bool
              do pos=0,16
                  bool = btest(i, pos)
                  print *, pos, bool
              end do
          end program test_btest

AUTHOR

This information was taken from the GFortran documentation (https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/) and converted to a manpage by AstroFloyd (http://astrofloyd.org).