Clicky

Fortran Wiki
btest (changes)

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

Showing changes from revision #3 to #4: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

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 .(追記) A (追記ここまで)(追記) value (追記ここまで)(追記) of (追記ここまで)(追記) zero (追記ここまで)(追記) refers (追記ここまで)(追記) to (追記ここまで)(追記) the (追記ここまで)(追記) least (追記ここまで)(追記) significant (追記ここまで)(追記) bit. (追記ここまで)

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

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

category: intrinsics

Revised on April 22, 2015 05:49:10 by Anonymous Coward (192.171.3.126) (791 characters / 0.0 pages)
Edit | Back in time (3 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, ibset

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