运算符(<=) 接口

公共接口运算符(<=)

如果set1set2中的位相同,或者最高阶不同的位在set1中设置为0,在set2中设置为1,则返回.true.,否则返回.false.。这些集合必须具有相同数量的位,否则结果未定义。(规范

示例

    program example_le
        use stdlib_bitsets
        type(bitset_64) :: set0, set1, set2
        call set0 % init( 33 )
        call set1 % init( 33 )
        call set2 % init( 33 )
        call set1 % set( 0 )
        call set2 % set( 32 )
        if ( set0 <= set1 .and. set1 <= set2 .and. set0 <= set2 .and. &
            set0 <= set0 .and. set1 <= set1 .and. set2 <= set2 .and. &
            .not. set1 <= set0 .and. .not. set2 <= set0 .and. .not.   &
            set2 <= set1 ) then
            write(*,*) 'Passed 64 bit less than or equal tests.'
        else
            error stop 'Failed 64 bit less than or equal tests.'
        end if
    end program example_le

函数

私有基本模块函数 le_64(set1, set2) 结果(le)

参数

类型 意图可选 属性 名称
类型(bitset_64), 意图(输入) :: set1
类型(bitset_64), 意图(输入) :: set2

返回值 逻辑

私有基本模块函数 le_large(set1, set2) 结果(le)

参数

类型 意图可选 属性 名称
类型(bitset_large), 意图(输入) :: set1
类型(bitset_large), 意图(输入) :: set2

返回值 逻辑