Skip to content

Math

Function To Compare Value with Tolerance

Public Function IsEqual(value1 As Variant, value2 As Variant, tolerance As Double)
    If Math.Abs(value1 - value2) <= tolerance Then
        IsEqual = True
        Exit Function
    End If
    IsEqual = False
End Function

Random Index Generation

Private Function GiveRandomIndex(maxIndex As Integer) As Integer
    GiveRandomIndex = Int(Rnd() * maxIndex) + 1
End Function