[UP]


Manual Reference Pages  - btest (3)

NAME

btest(3f) - [FORTRAN:INTRINSIC:BIT MANIPULATION] Bit test function

CONTENTS

Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also

SYNTAX

result = btest(i, pos)

DESCRIPTION

btest(i,pos) returns logical .true. if the bit at POS in I is set.

ARGUMENTS

I - The type shall be INTEGER.
POS - The type shall be INTEGER. A value of zero refers to the least significant bit.

RETURN VALUE

The return value is of type LOGICAL

EXAMPLE

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

STANDARD

[[Fortran 95]] and later

CLASS

[[Elemental procedure|Elemental function]]

SEE ALSO

[[ibclr]], [[ibits]], [[ibset]], [[iand]], [[ior]], [[ieor]], [[mvbits]]


btest (3) March 18, 2019
Generated by manServer 1.08 from 00127ee0-a7f7-4484-a8ce-a23f943badfd using man macros.