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

Integer Part Verify Function
Math Reals Class

Private Function IntegerPartVerify()
    ' Test the IntegerPart function.

    Debug.Assert IntegerPart(12345.6789) = 12345

    Debug.Assert IntegerPart(2.1) = 2
    Debug.Assert IntegerPart(2) = 2
    
    Debug.Assert IntegerPart(1.9) = 1
    Debug.Assert IntegerPart(1.1) = 1
    Debug.Assert IntegerPart(1) = 1
    
    Debug.Assert IntegerPart(0.9) = 0
    Debug.Assert IntegerPart(0.1) = 0
    Debug.Assert IntegerPart(0) = 0
    Debug.Assert IntegerPart(-0.1) = 0
    Debug.Assert IntegerPart(-0.9) = 0

    Debug.Assert IntegerPart(-1) = -1
    Debug.Assert IntegerPart(-1.1) = -1
    Debug.Assert IntegerPart(-1.9) = -1

    Debug.Assert IntegerPart(-2) = -2
    Debug.Assert IntegerPart(-2.1) = -2
    
    Debug.Assert IntegerPart(-12345.6789) = -12345

    Debug.Assert IsNull(IntegerPart(Null))
    Debug.Assert IsNull(IntegerPart("Joe"))

End Function

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