Clicky

Fortran Wiki
btest (Rev #1)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Description

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

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

category: Intrinsics

Revision from April 24, 2009 15:54:00 by Jason Blevins
Forward in time (3 more) | See current | History | Rollback | View: Source | Linked from: Intrinsic procedures, ibset

AltStyle によって変換されたページ (->オリジナル) /