Module
Contents
Index 🔎︎

# Eqv Operator

Menghitung ekuivalensi logika dari dua ekspresi.

## Sintaksis:

    Hasil = Ekspresi1 Eqv Ekspresi2

## Parameter:

Hasil: Variabel numerik apa saja yang mengandung hasil dari perbadindang.

Ekspresi1, Ekspresi2: Ekspresi apa saja yang hendak dibandingkan.

When testing for equivalence between Boolean expressions, the result is True if both expressions are either True or False.

In a bit-wise comparison, the Eqv operator only sets the corresponding bit in the result if a bit is set in both expressions, or in neither expression.

## Contoh:

    Sub ExampleEqv

    Dim A As Variant, B As Variant, C As Variant, D As Variant

    Dim vOut As Variant

        A = 10: B = 8: C = 6: D = Null

        vOut = A > B Eqv B > C REM menghasilkan -1

        vOut = B > A Eqv B > C REM menghasilkan 0

        vOut = A > B Eqv B > D REM menghasilkan 0

        vOut = (B > D Eqv B > A) REM menghasilkan -1

        vOut = B Eqv A REM menghasilkan -3

    End Sub