Could be some sort of rounding problem.
What data types are all of the variables uses?
using the wrong type can also cut off things like say decimal places.
If I remember right they should all be "Long" in order to hold ticks. I had a similar strange division problem when calculating an exchange rate when dividing.
Just out of curiosity, try to use "Today" instead of "Now", if it exists in B4A. I know it's in vb, but I don't remember seeing it here.