and_not Interface

public interface and_not

Sets the bits in set1 to the bitwise and of the original bits in set1 with the bitwise negation of set2. The sets must have the same number of bits otherwise the result is undefined.

(Specification)

Example

    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

Subroutines

private elemental module subroutine and_not_64(set1, set2)

Arguments

Type IntentOptional Attributes Name
type(bitset_64), intent(inout) :: set1
type(bitset_64), intent(in) :: set2

private elemental module subroutine and_not_large(set1, set2)

Arguments

Type IntentOptional Attributes Name
type(bitset_large), intent(inout) :: set1
type(bitset_large), intent(in) :: set2