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

Log N Real Verify Function
Math Reals Class

Private Function LogNRealVerify()
    ' Test the LogNReal function.
    
    ' Base 2
    Debug.Assert LogNReal(1, 2) = 0
    Debug.Assert LogNReal(2, 2) = 1
    Debug.Assert LogNReal(4, 2) = 2
    Debug.Assert LogNReal(8, 2) = 3
    Debug.Assert Approx(LogNReal(123, 2), 6.94251450533924)

    ' Base 10
    Debug.Assert Approx(LogNReal(0.01, 10), -2)
    Debug.Assert Approx(LogNReal(0.1, 10), -1)
    Debug.Assert LogNReal(1, 10) = 0
    Debug.Assert Approx(LogNReal(10, 10), 1)
    Debug.Assert Approx(LogNReal(100, 10), 2)
    Debug.Assert Approx(LogNReal(123, 10), 2.0899051114394)

    ' Base e
    Debug.Assert Approx(LogNReal(2, E), Log(2))
    Debug.Assert Approx(LogNReal(123, E), Log(123))

    ' Nulls
    Debug.Assert IsNull(LogNReal(Null, 2))
    Debug.Assert IsNull(LogNReal("Joe", 2))
    Debug.Assert IsNull(LogNReal(2, Null))
    Debug.Assert IsNull(LogNReal(2, "Joe"))

End Function

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