将 set1
中的位设置为 set1
中原始位与 set2
的按位取反的按位与。这些集合必须具有相同的位数,否则结果将是未定义的。
(规范)
program example_and_not
use stdlib_bitsets
type(bitset_large) :: set0, set1
call set0 % init(166)
call set1 % init(166)
call and_not( set0, set1 ) ! none none
if ( none(set0) ) write(*,*) 'First test of AND_NOT worked.'
call set0 % not()
call and_not( set0, set1 ) ! all none
if ( all(set0) ) write(*,*) 'Second test of AND_NOT worked.'
call set0 % not()
call set1 % not()
call and_not( set0, set1 ) ! none all
if ( none(set0) ) write(*,*) 'Third test of AND_NOT worked.'
call set0 % not()
call and_not( set0, set1 ) ! all all
if ( none(set0) ) write(*,*) 'Fourth test of AND_NOT worked.'
end program example_and_not
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
type(bitset_large), | intent(inout) | :: | set1 | |||
type(bitset_large), | intent(in) | :: | set2 |