Do you want a decimal result or is an integer good enough?

Integer division truncates ("round to zero") rather than to the nearest integer. You can use the modulus (remainder) to round up if appropriate.

If the speed is calculated as .333 / (t / 3600), this can be simplified to 1198.8 / t. To get more precision we can multiply each side by fifty (this keeps the large number on the left below 65535):

Code:

```
W0=59940 ; 1198.8 * 50
W1=760 ; 15.195 * 50
W2=W0/W1
```

This yields a result of 78, as expected (truncated). However, if we find the remainder of that division, we can use that to round upwards if the part of the result that would be after the decimal point is 0.5 or above:

Code:

```
W0=59940 ; 1198.8 * 50
W1=760 ; 15.195 * 50
W2=W0/W1
; Adjust result using the remainder.
W3=W0%W1
W1=W1/2
If W3 >= W1 Then
Inc W2
EndIf
```

This corrects the result to 79.

You can also use the remainder to calculate the part after the decimal point, if you don't mind losing a little precision:

Code:

```
W0=47952 ; 1198.8 * 40
W1=608 ; 15.195 * 40
W2=W0/W1
W3=W0%W1*100/W1
```

This returns the integral part in W2 and the fractional part to two (truncated) decimal places in W3; in this case, 78.86 (not great).

How you do this depends on the precision you require and range of values involved! In the above examples, if W1 (time) is too small or too large you'll get incorrect values. For robustness I'd be tempted to invest in an I²C floating-point coprocessor, or just use the PC that is receiving the data to perform the calculation.