- so worst case
max distance 4000 miles = 6437376 m
max time = 8 days = 69120000 1/ 100's of a second
v=(d/time)/100 (d in meters ,time in 1/100's of a second) = v in m/s
velocity= (6437376/69120000) /100 (to two decimals) as m/s
velocity= (6437376/69120000)*36 /1000 (to two decimals) as kph
and using Alain's figures
velocity= (6437376/69120000)*256 /(100*78) (to two decimals) as ft/s
etc.....................
just keep within the range of unsigned longs
a better strategy would be to examine the magnitude of the time and switch to hours at a suitable size and ditto for distance switch to kilometres for larger distances. you may be able to avoid longs
that way
Bookmarks