Sub Activity_Create(FirstTime As Boolean)
Log(ceil(0.6))
Log(ceil(0.4))
Log(ceil(5))
Log(ceil(5.1))
Log(ceil(-5.1))
Log(ceil(-5.9))
Log(ceil(-6))
End Sub
Sub ceil(Number As Double) As Double
Dim f As Double
f = Floor(Number)
If f = Number Then Return Number Else Return f + 1
End Sub
Sorry this is Basic4android code.
Here is the Basic4ppc version:
B4X:
Sub App_Start
Msgbox(Ceil(0.6))
Msgbox(Ceil(0.4))
Msgbox(Ceil(5))
Msgbox(Ceil(5.1))
Msgbox(Ceil(-5.1))
Msgbox(Ceil(-5.9))
Msgbox(Ceil(-6))
End Sub
Sub Ceil(Num As double) As double
Dim f As Double
f = Int(Num)
If f = Num Then Return f Else Return f + 1
End Sub
Sub App_Start
Msgbox(Ceil(0.6))
Msgbox(Ceil(0.4))
Msgbox(Ceil(5))
Msgbox(Ceil(5.1))
Msgbox(Ceil(-5.1))
Msgbox(Ceil(-5.9))
Msgbox(Ceil(-6))
End Sub
Sub Ceil(Num As double) As double
Dim f As Double
f = Int(Num)
If f < Num Then Return f Else Return f + 1
End Sub
Error Like
Sub Ceil(Num As double) As double
Syntax error
jothis
Sub App_Start
Msgbox(Ceil(0.6))
Msgbox(Ceil(0.4))
Msgbox(Ceil(5))
Msgbox(Ceil(5.1))
Msgbox(Ceil(-5.1))
Msgbox(Ceil(-5.9))
Msgbox(Ceil(-6))
End Sub
Sub Ceil(num)
f = Int(Num)
If f = Num Then Return f Else Return f + 1
End Sub