Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!austern@ux5.lbl.gov From: austern@ux5.lbl.gov (Matt Austern) Newsgroups: comp.sys.handhelds Subject: Dissecting unit objects on the HP48sx Message-ID: <6327@helios.ee.lbl.gov> Date: 31 Jul 90 08:33:21 GMT Sender: usenet@helios.ee.lbl.gov Reply-To: austern@ux5.lbl.gov (Matt Austern) Organization: Lawrence Berkeley Laboratory (theory group) Lines: 18 X-Local-Date: 31 Jul 90 01:33:21 PDT I've written a generalization of CONVERT to handle the unit systems that conventionally get used in high energy physics. (It's common to set hbar=c=1, so that, for example, 1 GeV might be a unit of energy, mass, frequency, or inverse length, depending on the context. It probably sounds goofy to you, but it really is convenient.) The trouble is that at one point, I need to know how many powers of each base unit are in some unit object. My current method works, but it is quite disgusting: I use UBASE, convert the result to a string, and then scan that string to find the exponents. Would anybody like to suggest a better way to do this? I couldn't think of anything better using documented functions, but maybe there's a way to do it using the internal representation of unit objects? Or maybe I just missed something obvious. -- Matthew Austern austern@lbl.bitnet It's not very subtle, but, uh, (415) 644-2618 austern@ux5.lbl.gov neither is blowing up a whole school.