XL Fortran for AIX 8.1

Language Reference


BTEST(I, POS)

Tests a bit of an integer value.

I
must be of type integer.

POS
must be of type integer. It must be nonnegative and be less than BIT_SIZE(I).

Class

Elemental function

Result Type and Attributes

The result is of type default logical.

Result Value

The result has the value .TRUE. if bit POS of I has the value 1 and the value .FALSE. if bit POS of I has the value 0.

The bits are numbered from 0 to BIT_SIZE(I)-1, from right to left.

Examples

BTEST (8, 3) has the value .TRUE..

If A has the value
   | 1 2 |
   | 3 4 |
the value of BTEST (A, 2) is
   | false false |
   | false true  |
and the value of BTEST (2, A) is
   | true  false |
   | false false |

See Integer Bit Model.


Specific Name Argument Type Result Type Pass As Arg?
BTEST (1) any integer default logical yes

Notes:

  1. IBM Extension.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]