@mdijkens
Int also does rounding, I think that it rounds toward zero, so as long as the argument is positive it will give the integer-part
here's the above snippet modded a bit
but if your language doesn't have the Ceil function then you can fake it
Ceil(x) = -Int(-x)
Int also does rounding, I think that it rounds toward zero, so as long as the argument is positive it will give the integer-part
here's the above snippet modded a bit
Code: (Select All)
For i = 1 To 10
x = i + .5
Print x, Int(-x)
Next
outputCode: (Select All)
1.5 -2
2.5 -3
3.5 -4
4.5 -5
5.5 -6
6.5 -7
7.5 -8
8.5 -9
9.5 -10
10.5 -11
if you are sure that you don't want any rounding then use Fixbut if your language doesn't have the Ceil function then you can fake it
Ceil(x) = -Int(-x)