btest(3f) - [FORTRAN:INTRINSIC:BIT MANIPULATION] Bit test function
Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also
result = btest(i, pos)
btest(i,pos) returns logical .true. if the bit at POS in I is set.
I - The type shall be INTEGER. POS - The type shall be INTEGER. A value of zero refers to the least significant bit.
The return value is of type LOGICAL
Sample program:
program demo_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 demo_btest
[[Fortran 95]] and later
[[Elemental procedure|Elemental function]]
[[ibclr]], [[ibits]], [[ibset]], [[iand]], [[ior]], [[ieor]], [[mvbits]]
btest (3) | March 18, 2019 |