Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.joehorn From: akcs.joehorn@hpcvbbs.UUCP (Joseph K. Horn) Newsgroups: comp.sys.handhelds Subject: HP 48 Yards.FeetInches Message-ID: <2855ad7d:3432comp.sys.handhelds@hpcvbbs.UUCP> Date: 12 Jun 91 05:40:05 GMT Lines: 25 Any mathematicians out there? I need your help. All the code I've seen written to handle Feet.Inches pulls the number apart into its int and frac parts, handles them, and then recombines. But some years ago, this algorithm for Hours.MinSec was published: +-----------------------------------------+ | HMS->(x) = x + FP(x)/1.5 + FP(x*100)/90 | +-----------------------------------------+ The fact that it works mystifies me. My question is: If this kind of algorithm works for H.MS, can similar ones be created for any arbitrary fractional systems, like Yards.FeetInches? If so, how? It would sure shrink and speed up a lot of programs. Thanx. BTW, just in case it helps or amuses, here's the inverse function: +-----------------------------------------+ | ->HMS(x) = x - .4*FP(x) - .004*FP(x*60) | +-----------------------------------------+ -- Joe Horn --