Post Reply 
(PC-1211) Engineering format
05-10-2022, 02:32 PM
Post: #1
(PC-1211) Engineering format
Most of the Sharp pocket computers don't have any built in engineering display format, so I whipped up this quickie to somewhat fill this gap. I wrote it on my PC-1211, but it should work on pretty much any model of Sharp that adheres to the INT function always rounding down (i.e. not truncate/round toward zero).

Usage

From the keyboard: press SHIFT (or DEF) = to display current input/result in engineering format. Note that attempting to do this in the middle of a running program will terminate the running program.

From a program: GOSUB "ENG" to convert X to mantissa and exponent stored in M and E respectively. You can then format these values as desired in your PRINT/USING statements.

Code:
1:"="AREAD X:GOSUB "ENG":PRINT M;"E";E:END
2:"ENG"E=0:M=0:IF X=0RETURN
3:E=3*INT (LOG ABS X/3):M=X/10^E:RETURN
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(PC-1211) Engineering format - Dave Britten - 05-10-2022 02:32 PM
RE: (PC-1211) Engineering format - Dan C - 05-10-2022, 05:15 PM
RE: (PC-1211) Engineering format - robve - 05-10-2022, 08:47 PM
RE: (PC-1211) Engineering format - robve - 05-11-2022, 10:38 PM
RE: (PC-1211) Engineering format - robve - 05-10-2022, 05:19 PM
RE: (PC-1211) Engineering format - robve - 05-10-2022, 09:16 PM
RE: (PC-1211) Engineering format - robve - 05-13-2022, 05:43 PM
RE: (PC-1211) Engineering format - robve - 05-15-2022, 09:24 PM
RE: (PC-1211) Engineering format - robve - 05-20-2022, 02:23 AM
RE: (PC-1211) Engineering format - robve - 05-13-2022, 08:12 PM
RE: (PC-1211) Engineering format - robve - 05-13-2022, 11:26 PM
RE: (PC-1211) Engineering format - robve - 05-16-2022, 12:38 AM
RE: (PC-1211) Engineering format - robve - 05-21-2022, 09:44 PM



User(s) browsing this thread: 1 Guest(s)