BTEST intrinsic function

Standard: F77 F90 F95 F2003 F2008 F2018 Example program



I : Integer;
POS : Integer, conformable with I, 0≤POS<BIT_SIZE(I);

Result : Logical (default kind).


The result is .TRUE. if bit POS in I is set to one, and .FALSE. otherwise; the least significant bit (value 1) is bit 0, the most significant bit is bit BIT_SIZE(I)−1.

This is an elemental function; if any argument is an array the result is an array of the same shape, with the BTEST operation being applied elementwise.


BIT_SIZE intrinsic function, IBCLR intrinsic function, IBSET intrinsic function