接口

公共接口 and

set1 中的位设置为 set1 中原始位与 set2 中位的按位 。集合必须具有相同数量的位,否则结果未定义。(规范

示例

    program example_and
        use stdlib_bitsets
        type(bitset_large) :: set0, set1
        call set0 % init(166)
        call set1 % init(166)
        call and( set0, set1 ) ! none none
        if ( none(set0) ) write(*,*) 'First test of AND worked.'
        call set0 % not()
        call and( set0, set1 ) ! all none
        if ( none(set0) ) write(*,*) 'Second test of AND worked.'
        call set1 % not()
        call and( set0, set1 ) ! none all
        if ( none(set0) ) write(*,*) 'Third test of AND worked.'
        call set0 % not()
        call and( set0, set1 ) ! all all
        if ( all(set0) ) write(*,*) 'Fourth test of AND worked.'
    end program example_and

子程序

私有元素模块子程序 and_64(set1, set2)

参数

类型 意图可选 属性 名称
type(bitset_64), intent(inout) :: set1
type(bitset_64), intent(in) :: set2

私有元素模块子程序 and_large(set1, set2)

参数

类型 意图可选 属性 名称
type(bitset_large), intent(inout) :: set1
type(bitset_large), intent(in) :: set2