<-- Previous || Up || Next -->

Power Verify Sub
Math Complex Class

Private Sub PowerVerify()
    ' Display some results of calling the Power function with some real number arguments
    ' to help verify that the function is working properly.

    Const Fmt = "#,##0.#;-#,##0.#"

    Dim dblCurNum As Double
    For dblCurNum = -2.5 To 2.5 Step 0.5
        Debug.Print
        
        Dim dblCurPow As Double
        For dblCurPow = -2.5 To 2.5 Step 0.5
            Debug.Print Format$(dblCurNum, Fmt) & " ^ " & Format$(dblCurPow, Fmt) & " = ";
            On Error Resume Next
            ' Debug.Print dblCurNum ^ dblCurPow
            Debug.Print Power(dblCurNum, dblCurPow)
            If Err Then Debug.Print "Error #" & Err & ": " & Error$
            On Error GoTo 0
        Next dblCurPow
    Next dblCurNum
End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.