The Museum of HP Calculators


Convert Inches.decimal to Inches Fraction for the HP42s

This program is by Dwight Sturrock and is used here by permission.

This program is supplied without representation or warranty of any kind. Dwight Sturrock and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

This is program I wrote and used for many years in the woodworking industry. It converts a decimal fraction or mixed decimal fraction into a fraction readable on a tape measure:
 2.625      converts to   2 5/8
 .0625      converts to   1/16
 5.5656     converts to   5 9/16
The program simply takes whatever number is in the x register and converts it, displaying it alphanumerically.

Listing

00 { 64-Byte Prgm }
01 LBL "x/16"
02 ABS
03 STO 10
04 FP
05 16
06 STO 01
07 ×
08 FIX 00
09 RND
10 FIX 03
11 STO 00
12 GTO 09
13 LBL 09
14 RCL 00
15 2
16 ÷
17 STO 02
18 FP
19 X≠0?
20 GTO 08
21 RCL 01
22 2
23 ÷
24 STO 03
25 RCL 02
26 STO 00
27 RCL 03
28 STO 01
29 GTO 09
30 LBL 08
31 CLA
32 RCL 10
33 AIP
34 ⊢ " "
35 RCL 00
36 AIP
37 ⊢ "/"
38 RCL 01
39 AIP
40 AVIEW
41 RCL 10
42 END

Go back to the software library
Go back to the main exhibit hall