i cant see multiy by 100 is going to help
speed = distance / time

also cant see how i can avoid floating points and longs again ;(


distance = distance base measurement ( feet or meters or km or miles ) x distance input value
time = time base measurement ( sec or mins or hours or lap count ) x time measured value

for the caclulation of distance i though convert all values to meters as common base value


if meters option then Distbase_value = 1 ' = 1 meter
if feet option then Distbase_value = 3.28 ' = feet to meters
if Km option then Distbase_value = 1000 ' = 1 km in meters
if Miles option then Distbase_value = 1609.34 ' = 1 mile in meters

Dist_input = 0 - 4000
Distbase_value x Dist_input = Distance ' 24 bit number max ???



Calculation for Time base - make a sec the common base to work to

if sec option then Timebase_value = 1 ' = 1 sec base
if min option then Timebase_value = 60 ' = 60 sec in min
if hour option then Timebase_value = 3600 ' = 3600 sec in hour

TimeValue = days/hours/min/sec /1_100th - convert time to secs base

timevalue = days x 24 x 60 x 60 ' days
timevalue = timevalue + (hours x 60 x 60) ' hours
timevalue = timevalue + ( mins x 60) ' mins
timevalue = timevalue + sec ' sec
timevalue = timevalue + (100th / 100) ' 1_100th

timevalue eg 12456.78

timebase x timevalue = Time


speed = distance / time ' speed is a max 32bit positive number

is this seem right or am i doing the long and hard way , with larger number than need to

i am just starting to read up on Floating point , with the include of "FP1832.bas" and what i think is required as well , but not sure where to put them yet in the program of Fp32.A18 and math18.inc files

sheldon