Isn't that a Min function.
On Error Resume next
L = Ubound(ary)
if Err.Number <> 0 then L = -1
On Error Goto 0
If L >=0 then
floor = ary(0)
For I = 1 t0 Ubound(ary)
if ary(I) < floor then floor = ary(I)
End if
End If
Personally I have seen many cases where this misguided definition of Int( ) (and its unsuspecting use) has caused bug after bug. I can't think of one appropriate use for Iverson's floor( ), but we're stuck with it as a pitfall awaiting unwary VB and VBScript programmers.
So the question really shouldn't be how to use floor( ), but instead how to avoid it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.