Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sdd.hp.com!hp-pcd!hpcvra!billw From: billw@hpcvra.CV.HP.COM (William C Wickes) Newsgroups: comp.sys.handhelds Subject: Re: HP48 units bug Message-ID: <25590059@hpcvra.CV.HP.COM> Date: 20 Sep 90 00:33:56 GMT References: <1990Sep19.024034.15518@mintaka.lcs.mit.edu> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 44 Christopher Moore writes: > I have discovered what appears to be a previously unreported bug in my > revision D ROMs. The units application fails to properly handle units > with fractional powers. The bug here is that the HP 48SX manual fails to document the unit management system properly; it should have specified that while 48 units may have fractional powers, those powers are converted to signed 8-bit integers for the sake of dimension checking. Thus while you can successfully add 1_m^.5 +1_cm^.5, you can also add 1_m^.5 + 1_cm^.4 without the 48 reporting an error. The dimension checking limitation also carries over to UBASE, and UFACT, which executes UBASE; these return meaningless results for fractional exponents. The HP customer support representative was correct in stating that this design was intentional. There is a considerable amount of processing involved in unit operations, and representing the base unit dimensions with small integers provides a considerable efficiency compared with using floating-point numbers. The loss of ability to handle fractional exponents in all circumstances was taken as a modest price to pay for the speed gain, given that the great majority of physical problems involves integer powers of units. There are many cases where fractional powers may appear then disappear in the course of calculations, but these can be generally be handled correctly within the 48 system with a little care in the order of operations. The HP 48SX unit management system is a valuable tool that can be applied to a wide range of physical problems (in 10 years of university physics research and teaching, I don't recall any unit manipulations that would have been intractable on a 48, although my memory may be biased). This is little consolation if it doesn't work for your particular problem, but there are other things you can't do on a 48. The key is proper documentation that lets you know the reach and limitations of your tools. We fell short in this case, but documenting the 48 for a very wide range of customers was and is a massive task. It might be helpful to the user community if Mr. Moore and others could to post some example problems involving fractional units, so that we can study how they might be dealt with on the 48. Bill Wickes billw@cv.hp.com