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