Monday, August 27, 2018

HP 12C Platinum and DM 41L: Rounding Numbers


HP 12C Platinum and DM 41L:  Rounding Numbers

Introduction

The following programs will round any positive number to any number of decimal places, regardless of your fix/float settings.  The formula for rounding x to n decimal places:

int(10^n * x + 0.5) / 10^n

HP 12C Platinum Program (also for HP 12C): Rounding a positive number

Step
Key Code
Key

001
1
1

002
0
0

003
34
x<>y

004
21
y^x

005
20
*

006
43, 40
LST x
For HP 12C regular: the code is 43, 36
007
34
x<>y

008
48
.

009
5
5

010
40
+

011
43, 25
ITNG

012
34
x<>y

013
10
÷

014
43, 33, 000
GTO 000


DM 41L (also for HP 41C) Program ROUND: Rounding a positive number

01 LBL ROUND
02 10^X
03 *
04 LASTx
05 x<>y
06 .5
07 +
08 INT
09 x<>y
10 /
11 RTN

Examples

Instructions:  Enter x, press [ENTER], enter n, execute the program

x
n
Result
0.83
1
0.8
8.21365
4
8.2137
170561.7737
0
170562
π
4
3.1416

Source:

Keith Oldham, Jan Myland, and Jerome Spanier  An Atlas of Functions Second Edition,  Springer.  2009 ISBN 978-0-387-48806-6

Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Sunday, August 26, 2018

Happy 100th Birthday Katherine Johnson!


Happy 100th Birthday Katherine Johnson!

Happy birthday to a legend in mathematics and astronomy, Katherine Johnson! 

Learn more about this legendary mathematician who played a huge role in of getting astronauts into space while breaking down doors and societal barriers here:

NASA’s autobiography of Katherine Johnson:

West Virginia State University Honors Johnson and Names a Scholarship after her:

Daily Press:  ‘Human Computer’ turns 100

May the 100th birthday find the Ms. Johnson in good health and in good spirits.  May the women of Hidden Figures be no longer hidden and remembered and celebrated for centuries to come.

Eddie

HP 12C Platinum: Cosine of an Angle


HP 12C Platinum:  Cosine of an Angle

Introduction

This is a fairly short program of an angle.  The angle is in radians.  This is adapted from the TI-84 Plus COSRAD program from the book Inside Your Calculator (see Source section below).

HP 12C Platinum Program:  Cosine of an Angle

The angle is entered in radians.  This program can be adopted for the regular HP 12C.

Step
Key Code
Key
Comment
001
44, 0
STO 0
Begin program
002
2
2

003
21
y^x
You could use x^2 on the Platinum
004
4
4

005
2
2

006
9
9

007
4
4

008
9
9

009
6
6

010
7
7

011
2
2

012
9
9

013
6
6

014
10
÷

015
44, 1
STO 1

016
1
1
Set counter
017
6
6

018
44, 2
STO 2

019
4
4
Loop begins
020
45, 1
RCL 1

021
30
-

022
45, 1
RCL 1

023
20
*

024
44, 1
STO 1

025
1
1

026
44, 30, 2
STO- 2
Decrease counter
027
45, 2
RCL 2

028
43, 35
x=0

029
43, 33, 031
GTO 031

030
43, 33, 019
GTO 019

031
1
1

032
45, 1
RCL 1

033
2
2

034
10
÷

035
30
-

036
43, 33, 000
GTO 000


Examples (FIX 6 setting):

cos 0.445 ≈ 0.902611
cos 2 ≈ -0.416147
cos -4.180 ≈ -0.507593
cos π/6 ≈ cos 0.523599 ≈ 0.866025

Source:

Gerald R. Rising.  Inside Your Calculator:  From Simple Programs to Significant Insights  Wiley-Interscience, John Wiley & Sons, Inc: Hoboken, New Jersey.  2007. ISBN 978-0-470-11401-8

Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Saturday, August 25, 2018

HP 15C: Pricing Calculations (Gamo)


HP 15C:  Pricing Calculations (Gamo)

Introduction

The following program is a solver for cost, price, markup, and margin – developed by Gamo, which was emailed to me. The program (shown for the HP 15C).  Program listed here with permission and much thanks and gratitude to Gamo. 


HP 11C and HP 15C Program:  Pricing Calculations

Note:  Key codes are for the HP 15C. 

Step
Key Code
Key
Comment
001
42, 21, 11
LBL A
Start Cost Routine
002
44, 1
STO 1

003
0
0

004
43, 30, 6
TEST 6, xy

005
43, 32
RTN

006
45, 2
RCL 2

007
1
1

008
45, 3
RCL 3

009
43, 14
%

010
40
+

011
10
÷

012
43, 32
RTN





013
42, 21, 12
LBL B
Start Price Routine
014
44, 2
STO 2

015
0
0

016
43, 30, 6
TEST 6 , xy

017
43, 32
RTN

018
45, 1
RCL 1

019
45, 3
RCL 3

020
43, 14
%

021
40
+

022
43, 32
RTN





023
42, 21, 13
LBL C
Enter Markup Routine
024
44, 3
STO 3

025
0
0

026
43, 30, 6
TEST 6, x y

027
43, 32
RTN

028
45, 1
RCL 1

029
45, 2
RCL 2

030
43, 15
Δ%

031
43, 32
RTN





032
42, 21, 14
LBL D
Margin to Markup routine
033
44, 4
STO 4

034
0
0

035
43, 30, 6
TEST 6, xy

036
43, 32
RTN

037
45, 3
RCL 3

038
15
1/x

039
26
EEX

040
16
CHS

041
2
2

042
40
+

043
15
1/x

044
43, 32
RTN





045
42, 21, 15
LBL E
Markup to Margin routine
046
44, 3
STO 3

047
0
0

048
43, 30, 6
TEST 6, xy

049
43, 32
RTN

050
45, 4
RCL 4

051
15
1/x

052
26
EEX

053
16
CHS

054
2
2

055
30
-

056
15
1/x

057
43, 32
RTN


Registers: 

R1 = Cost
R2 = Price
R3 = Markup
R4 = Margin

Instructions:

The program primary runs on the cost-price-markup calculation, which belongs to labels A, B, and C, respectively.

Conversions between margin and markup are used between labels D and E.  Gamo recommends that you set the calculator in FIX 2 mode and press [ f ] (USER) prior to running this program.

This program is set up to be a solver similar to the HP 12C and Hewlett Packard other financial calculators. 

Examples

It is assumed that FIX 2 is set and USER mode is turned on.

Example 1: (from Gamo)

Cost = 66.46
Price = 105.00

Keystrokes:

66.46 [ A ]
105.00 [ B ]
[ C ], Markup =  57.99
[ C ] [ D ], Margin = 36.70

Example 2: 

Cost = 2500.00
Margin = 10.00

2500 [ A ]
10 [ D ]
[ E ] [ C ] [ B ],  Price = 2777.78

Example 3:

Price = 48.75
Markup = 10.00

48.75 [ B ]
10.00 [ C ]
[ A ], Cost = 44.32

Example 4:  Margin/Markup Calculation

Markup = 54.00

54.00 [ E ]
[ D ],  Margin = 35.06

Eddie


 All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Spotlight: Akron Brass FireCalc Pocket Computer

Spotlight: Akron Brass FireCalc Pocket Computer Welcome to a special Monday Edition of Eddie’s Math and Calculator blog. Thi...