Private Sub FloorVerify() ' Test the Floor function. ' Precision = .5 Debug.Assert Floor(1.4, 0.5) = 1 Debug.Assert Floor(1.1, 0.5) = 1 Debug.Assert Floor(1, 0.5) = 1 Debug.Assert Floor(0.9, 0.5) = 0.5 Debug.Assert Floor(0.6, 0.5) = 0.5 Debug.Assert Floor(0.5, 0.5) = 0.5 Debug.Assert Floor(0.4, 0.5) = 0 Debug.Assert Floor(0.1, 0.5) = 0 Debug.Assert Floor(0, 0.5) = 0 Debug.Assert Floor(-0.1, 0.5) = -0.5 Debug.Assert Floor(-0.4, 0.5) = -0.5 Debug.Assert Floor(-0.5, 0.5) = -0.5 Debug.Assert Floor(-0.6, 0.5) = -1 Debug.Assert Floor(-0.9, 0.5) = -1 Debug.Assert Floor(-1, 0.5) = -1 Debug.Assert Floor(-1.1, 0.5) = -1.5 Debug.Assert Floor(-1.4, 0.5) = -1.5 ' Precision = 1 Debug.Assert Floor(2.9) = 2 Debug.Assert Floor(2.1) = 2 Debug.Assert Floor(2) = 2 Debug.Assert Floor(1.9) = 1 Debug.Assert Floor(1.1) = 1 Debug.Assert Floor(1) = 1 Debug.Assert Floor(0.9) = 0 Debug.Assert Floor(0.1) = 0 Debug.Assert Floor(0) = 0 Debug.Assert Floor(-0.1) = -1 Debug.Assert Floor(-0.9) = -1 Debug.Assert Floor(-1) = -1 Debug.Assert Floor(-1.1) = -2 Debug.Assert Floor(-1.9) = -2 Debug.Assert Floor(-2) = -2 Debug.Assert Floor(-2.1) = -3 Debug.Assert Floor(-2.9) = -3 ' Precision = 2 Debug.Assert Floor(5.9, 2) = 4 Debug.Assert Floor(4.1, 2) = 4 Debug.Assert Floor(4, 2) = 4 Debug.Assert Floor(3.9, 2) = 2 Debug.Assert Floor(2.1, 2) = 2 Debug.Assert Floor(2, 2) = 2 Debug.Assert Floor(1.9, 2) = 0 Debug.Assert Floor(0.1, 2) = 0 Debug.Assert Floor(0, 2) = 0 Debug.Assert Floor(-0.1, 2) = -2 Debug.Assert Floor(-1.9, 2) = -2 Debug.Assert Floor(-2, 2) = -2 Debug.Assert Floor(-2.1, 2) = -4 Debug.Assert Floor(-3.9, 2) = -4 Debug.Assert Floor(-4, 2) = -4 Debug.Assert Floor(-4.1, 2) = -6 Debug.Assert Floor(-5.9, 2) = -6 ' Other Debug.Assert IsNull(Floor(Null)) Debug.Assert IsNull(Floor("Joe")) Debug.Assert Floor(2.9, Null) = 2 Debug.Assert Floor(2.9, "Joe") = 2 End Sub
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.