Wednesday, August 19, 2026

Spotlight: HP 16C Collector’s Edition

 Spotlight: HP 16C Collector’s Edition



Quick Facts: HP 16C Collector’s Edition



Model: HP 16C Collector’s Edition

Company: Hewlett Packard/Moravia


Type: RPN and Computer Science

Batteries: 2 x CR2032

Memory: Up to 34 memory registers

Programming Memory: Up to 203 memory registers

Years in Production:

Original: 1982-1989

Collector’s Edition: 2026 (limited edition)

Display: 8 digits (scrolling)


Store sites:

Europe: https://www.thecalculatorstore.com/i/the-hp16c

U.S.: https://shop.moravia.education/us/hp-16c-collector-s-edition.html





About the HP 16C


This is my first HP 16C from Hewlett Packard, and it’s a long awaited purchase. The HP 16C is a programmable calculator that is specialized in computer science. There are five main modes:


HEX: Hexadecimal integer mode (base 16, 2^4)

DEC: Decimal integer mode (base 10)

OCT: Octal integer mode (base 8, 2^3)

BIN: Binary integer mode (base 2)

FLOAT: Floating decimal mode.


The FLOAT mode is the only mode where calculations can involved fractions and non-integers. To make room for the Boolean logic and bit functions, the number of functions for floating point are limited to the reciprocal (1/x) and square root (√x).


The other four modes work with integers. The HP 16C is able to work with integers with up word sizes up to 64 bits. Each bit is is a binary bit. For example, a word size of 4 binary integers range from 0000 and 1111. Pressing [ 0 ] [ f ] [ STO ] (WSIZE) is a quick reset to a word size of 64 bits.


Integers can scroll beyond the initial screen of 8 digits, with multiple windows to show all the digits.


We have the classical Boolean functions available: AND, OR, NOT, and XOR. Part of what makes the HP 16C special is addition of bit manipulation functions:


* Shift bits left and right, including the carry over bit: SL, SR


* Arithmetic shift right, where bits are shifted right with the sign bit copied: ASR


* Rotate bits left and right: RL, RR, RL n, RR n (either a single bit or n bits); RLC, RRC, RLC n, RRC n (these are rotation functions including the carry over bit).


* Masks can be generated using the MASKL and MASKR functions.


* Integer division can be accomplished by finding the quotient (÷) and remainder (RMD).


* Finally, the HP 16C can work with double-sized words, potentially after 128 bits, with the double-multiply (DBL×), double-division (DBL÷), and double-remainder (DBLR).



The programming module can hold up to 203 steps, complete with loops, indirect addressing, testing, but no storage or recall arithmetic. Here are a couple of programs:


Integer Division: y |- x


Input Stack:
Y: dividend

X: divisor


Result: quotient, R/S, remainder


Code:


LBL D ; 001 43, 22, d

x<>y ; 002 34

STO 0 ; 003 44, 0

x<>y ; 004 34

÷ ; 005 10

R/S ; 006 31

RCL 0 ; 007 45, 0

LST x ; 008 43, 36

RMD ; 009 42, 9

RTN ; 010 43, 21


Examples


Example 1: 45 d |- 20 d = 2 d remainder 11 d

Keystrokes: DEC 45 ENTER 17 GSB D

Results: 2 d R/S 11 d


Example 2: 1F3 h |- 20 h = F h remainder 13 h

Keystrokes: HEX 1F3 ENTER 20 GSB D

Results: F h R/S 13 h


Hexadecimal: Showing One Hexadecimal Digit at a Time, From Right to Left


This program creates and then manipulates the mask to display each digit.


_ _ _ #

_ _ # 0

_ # 0 0

# 0 0 0


Code:


LBL A ; 001 43, 22, A

STO 0 ; 002 44, 0

CL x ; 003 43, 35

WSIZE ; 004 42, 44

HEX ; 005 23

F ; 006 F

ENTER ; 007 36

1 ; 008 1

+ ; 009 40

WSIZE ; 010 42, 44


RCL 0 ; 011 45, 0

4 ; 012 4

MASK4 ; 013 42, 8

AND ; 014 42, 40

R/S ; 015 31


3 ; 016 3

STO I ; 017 44, 32

LBL 0 ; 018 43, 22, 0

LST x ; 019 43, 36

4 ; 020 4

RL n ; 021 42 E

RCL 0 ; 022 45, 0

x<>y ; 023 34

AND ; 024 42, 20

R/S ; 025 31

DSZ ; 026 43, 23

GTO 0 ; 027 22, 0

RTN ; 028 43, 21


Examples


4F37 h GSB A: 1 R/S 20 R/S 400 R/S 5000


17695 d GSB A: F R/S 10 R/S 500 R/S 4000 (451F h)


The speed of the HP 16C Collector’s Edition is comparable to the HP 15C Collector’s Edition. I found the keys to be responsive and reliable.


Eddie


Sources:


“HP-16C” The Museum of HP Calculators. https://www.hpmuseum.org/hp16.htm Retrieved August 17, 2026.


Hewlett Packard. HP 16c Collector’s Edition: Owner’s Handbook. Edition 2, November 2025. From the HP Calculator Literature website: https://literature.hpcalc.org/items/2714





Eddie


All original content copyright, © 2011-2026. 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.


Saturday, August 15, 2026

HP 48G Collection

 HP 48G Collection 


Contents: 

Intensity of Spherical Light Source 

Speed of Light in Dry Air 

Pressure of Air 

Earth's Gravity at a Specific Latitude 

Light of Sight: Altitude


Intensity of the Spherical Light Source



INTSP: 

<< '1_cm' * '1_m' CONVERT SQ 4 * π * →NUM SWAP '1_W' * SWAP / >>


I = P/(4π(r/100)^2)


Input: 

2: power in Watts (W) 

1: spherical radius in centimeters (cm) No need to enter units.

Output: 

1: intensity (W/m^2) with unit object attached



Example:

Input: 

2: 1368 (W) 1: 5 (cm)

Output: 

1: ≈ 43544.7924_W/m^2



Speed of Sound in Dry Air


CAIR: 

<< '1_°C' * '1_K' CONVERT 1.4 * 'R' CONST * '.289647_kg/mol' / UBASE √ >>


c_air = √(φR(T°C+273.15)/M_air) 

φ = 1.4, ideal adiabatic of air 

M_air = 0.289647 kg/mol, mole of air molecule 

R ≈ 8.314462 J/(mol K), ideal gas constant


Input: 

1: temperature in degrees Celsius (°C) No need to enter units


Output: 

1: speed of sound in air (m/s) with unit object attached


Example:


Input: 

1: 18 (°C)

Output: 

1: ≈ 342.0631_m/s


Pressure of Air


ρAIR (ρ character: [ α ] [ |→ ] [ R ]): 

<< '1_°C' * '1_K' CONVERT 287.05007 '1_J' * '1_kg' / '1_K'

* INV 'StdP' CONST '1_Pa' CONVERT * UBASE >>


ρ = P/(R*(T°C+273.15)) 

P = 101325 Pa, Standard temperature of pressure 

R = 287.05007 J/(kg K)


Input: 

1: temperature in degrees Celsius (°C) No need to enter units

Output: 

1: air pressure_J/(kg K) with unit object attached


Example:


Input: 

1: 18 (°C)

Output: 

1: ≈ 1.2124_kg/m^3


Earth's Gravity at a Specific Latitude


The true earth gravity force depends on several factors, such as latitude and altitude. This estimation takes the latitude (north/south) into account.

The constant 9.80665 m/s^2 is an accepted average, the true force varies.


gLAT: 

<< RAD HMS→ 90 / π * →NUM COS .026 * 9.806 SWAP - '1_m/s^2' * >>


g_Earth = g_45-(g_poles + g_equ) / 2 * cos(lat * π / 90 radians) 

Simplified: g_Earth = 9.806 – 0.026 * cos(lat * π / 90)

g_45 ≈ 9.806 m/s^2 

g_poles ≈ 9.832 m/s^2 

g_equ ≈ 9.78 m/s^2 Take the cosine of (latitude * π / 90) radians


Input: 

1: latitude in D.MMSS (degrees, minutes, seconds) No need to enter units

Output:

1: Earth's gravity at latitude_m/s^2 with unit object attached



Example:

Input:
1: 20.2214 (20°22'14")

Output: 

1: ≈ 9.7863_m/s^2

Source: Grainger Engineering Office of Marketing and Communications. (answer written by Rebecca H.) (2016, November 21). “How gravitational force varies at different locations on Earth.” Illinois. https://van.physics.illinois.edu/ask/listing/64061. Retrieved March 10, 2026.



Light of Sight: Altitude

The program calculates altitude required for an airplane to receive a signal from an airplane.


Program LOSALT: 

<< '1_nmi' * 3 ROLLD '1_ft' * '1_nmi' CONVERT '3440_nmi' + SQ 3 ROLLD '1_ft' * '1_nmi' CONVERT '3440_nmi' + SQ DUP 4 ROLL SWAP - √ 3 ROLL SWAP - SQ + √ '3440_nmi' - '1_ft' CONVERT >>


Inputs: 

3: height of the antenna in feet 

2: average height of the terrain between the airplane and antenna 

1: horizontal distance from airplane to antenna in nautical miles

Enter numbers only, no need to attach units.


Output: 

1: required height in feet, _ft unit object attached


Example: 


height of antenna: 426 ft 

average terrain height: 846 ft 

horizontal distance: 57 nautical mi

required altitude: ≈1519.7282 ft

Note: An average Earth radius is 3440 nautical miles is used. Results will vary since Earth is a spheroid.


Formulas Used:

R_ter: terrain height, Rt = radius_Earth + R_ter 

R_atn: antenna height, Ra = radius_Earth + R_atn 

D: distance to antenna 

R_alt: altitude 1 nmi ≈ 6076.1155 ft R_alt = √(Ra^2 + (D - √(Ra^2 - Rt^2))^2) – radius_Earth



This is a partial adaption of the line of sight distance program of the HP 67.

Source: Hewlett Packard. "Line of Sight Distance" HP-67/HP-97 User's Library Solutions: Avigation. Corvallis, OR. Rev. E. April 1979. pp. 18-22


Eddie

All original content copyright, © 2011-2026. 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.

Sunday, August 9, 2026

First Look: HP 16C Collector's Edition

 First Look: HP 16C Collector's Edition


I just got the HP 16C Collector's Edition.   This is the famous HP 16C that specializes in computer science.   I plan to be working with the calculator and come up with a review in a few weeks. (It's been hectic at the house and at work!)  


Places to purchase (there is a limited quantity, please be aware): 

https://hpcalcs.com/product/hp-16c-collectors-edition/

https://shop.moravia.education/hp-16c-collector-s-edition.html

https://www.thecalculatorstore.com/p/hp16c-collector-s-edition










Eddie 


All original content copyright, © 2011-2026. 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.


Saturday, August 8, 2026

Python: Combination Functions (Micropython)

Python: Combination Functions (Micropython)


This is a set of combination functions. Programmed with a Casio fx-CG 100 but should work on any calculator with Python.


The script is freeware.


Functions included:


 fact(n): Factorial of the non-negative integer n. Some math modules include a factorial function, like Numworks. This function will be used in all the functions on this script.


ncr(n,r): Combination


npr(n,r): Permutation


nhr(n,r): Combination, repetitions are allowed


catalan(n): nth Catalan Number


narayana(n,k): Narayana Number (n, k are positive integers)


binpdf(n,k,p): Binomial Probability:

n: trials

k: number of successes

p: probability of success


bndcdf(n,k,p): Cumulative Binomial Probability – Lower Tail

n: trials

k: number of successes (from 0 to k)

p: probability of success



Script: combo.py

'''

combinatorics 4/12/2026

Edward Shore


round to nearest integer:

int(f+.5)

'''


from math import *


# factorial positive integers

def fact(n):

  f,i=1,1

  while i<=n:

    f*=i

    i+=1

  return int(f+.5)


# a lot of functions will use fact


# combination

def ncr(n,r):

  f=fact(n)/(fact(r)*fact(n-r))

  return int(f+.5)


# permutation

def npr(n,r):

  f=fact(n)/fact(n-r)

  return int(f+.5)


# combination w/repetitions

def nhr(n,r):

  f=fact(n+r-1)/(fact(r)*fact(n-1))

  return int(f+.5)


# catalan numbers

def catalan(n):

  f=fact(2*n)/(fact(n)**2*(n+1))

  return int(f+.5)


# narayana numbers

def narayana(n,k):

  f=1/n*ncr(n,k)*ncr(n,k-1)

  return int(f+.5)


# binomial probability

def binpdf(n,k,p):

  # p=prob

  f=ncr(n,k)*p**k*(1-p)**(n-k)

  return f


# bin lower tail

def bincdf(n,k,p):

  # 0 to k, p=prob

  s=0

  for i in range(k+1):

    s+=binpdf(n,i,p)

  return s



Eddie


All original content copyright, © 2011-2026. 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.


Saturday, August 1, 2026

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues

DM42 and HP 42S: Quadratic Equation, Characteristic Polynomial, and Eigenvalues




The programs are listed for the Swiss Micros DM42 and Hewlett Packard 42S.



All examples are on rounded to four decimal places and complex mode turned on (CPXRES).



Monic Quadratic Equation: quad2.raw



The program QUAD2 solves the equation for w:

w² + Y * w + X = 0

Y: contents of stack Y

X: contents of stack X



Code:

00 { 35-Byte Prgm }

01▸LBL "QUAD2"

02 X<>Y

03 ENTER

04 2

05 ÷

06 +/-

07 ENTER

08 X↑2

09 X<>Y

10 R↓

11 X<>Y

12 -

13 SQRT

14 R↑

15 X<>Y

16 ENTER

17 ENTER

18 R↑

19 ENTER

20 R↓

21 X<>Y

22 +

23 R↓

24 -

25 R↑

26 RTN

27 .END.



Example 1: w² + 7 * w + 5 = 0

Stack: Y: 7, X: 5

Results: -6.1926, -0.8074



Example 2: w² – 4 = 0

Stack: Y: 0, X: -4

Results: -2.0000, 2.0000



Characteristic Polynomial: char2.raw



The program CHAR2 find the coefficients of 2 x 2 matrix:

[ [ A, B ] [ C , D ] ]

Result: λ² – T1 * λ + T2 = 0 where

T1 = A + D

T2 = det([[ A, B ] [ C, D ]]) = A * D – C * B



The program provides prompts and results in messages.



Code:

00 { 81-Byte Prgm }

01▸LBL "CHAR2"

02 "[[A,B][C,D]]"

03 AVIEW

04 PSE

05 PSE

06 "L↑2-T1×L+T2=0"

07 AVIEW

08 PSE

09 PSE

10 INPUT "A"

11 ENTER

12 ENTER

13 INPUT "D"

14 ENTER

15 R↓

16 +

17 "T1= "

18 ARCL ST X

19 AVIEW

20 STOP

21 R↓

22 ×

23 INPUT "C"

24 INPUT "B"

25 ×

26 -

27 "T2= "

28 ARCL ST X

29 AVIEW

30 RTN

31 .END.



Example 1: [ [ -6, 4 ] [ 2, 3 ] ]

Results: T1: 3, T2: -26



Example 2: [ [ 5, 8 ] [ -1, 2 ] ]

Results: T1: 7, T2: 18



Eigenvalues of 2 x 2 Matrices: egn2.raw



The program EGNV2 calculates the eigenvalues of a 2 x 2 matrix:

[ [ A, B ] [ C , D ] ]



The program provides prompts and results in messages. The command CPXRES sets the calculator to accept complex number results.



Code:

00 { 106-Byte Prgm }

01▸LBL "EGNV2"

02 CPXRES

03 "[[A,B][C,D]]"

04 AVIEW

05 PSE

06 PSE

07 INPUT "A"

08 INPUT "B"

09 INPUT "C"

10 INPUT "D"

11 RCL "A"

12 RCL "D"

13 +

14 +/-

15 RCL "A"

16 RCL "D"

17 ×

18 RCL "B"

19 RCL "C"

20 ×

21 -

22 X<>Y

23 ENTER

24 2

25 ÷

26 +/-

27 ENTER

28 X↑2

29 X<>Y

30 R↓

31 X<>Y

32 -

33 SQRT

34 R↑

35 X<>Y

36 ENTER

37 ENTER

38 R↑

39 ENTER

40 R↓

41 X<>Y

42 +

43 "E1="

44 ARCL ST X

45 AVIEW

46 PSE

47 PSE

48 R↓

49 -

50 "E2="

51 ARCL ST X

52 AVIEW

53 PSE

54 PSE

55 R↑

56 RTN

57 .END.



Example 1: [ [ -6, 4 ] [ 2, 3 ] ]

Results: 3.8151, - 6.8151



Example 2: [ [ 5, 8 ] [ -1, 2 ] ]

Results: 3.5 ± 2.37792 i


You can download the three programs here: https://drive.google.com/file/d/1SKcVIhKYHnnuhrvBJxfOmwsV8sRTSj0X/view?usp=sharing





Eddie


All original content copyright, © 2011-2026. 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.

Saturday, July 25, 2026

Earth's Radius by Latitude

Earth's Radius by Latitude




Introduction: Calculating the Earth’s Radius



In quick, general calculations, we assume that the shape of the Earth approximates the shape of sphere, with the radius to generally be approximated as 6371 km. However, the shape of the Earth is closer to an oblate ellipsoid. The Earth is flattened at the poles and bulges the greatest at the Equator.



There are several calculations to estimate the Earth’s radius given the latitude (degrees North or South from the Equator), this blog is working with the WGS 84 formula (see Source):



R = √[ ((a² * cos(φ))² + (b² * sin(φ))²) ÷ ((a * cos(φ))² + (b * sin(φ))²) ]



Which is simplified from:



R = √[ (a^4 + b^4 * tan²(φ)) ÷ (a² + b² * tan²(φ))



where:

φ: latitude (in degrees)

a: semi-major axis: 6378.137 km

b: semi-minor axis: 6356.7523142 km

R: radius of kilometers



HP 15C Code: Earth’s Radius by Latitude

Step; Key; Key Code

001: LBL E; 42, 21, 15

002: DEG; 43, 7

003: →H; 43, 2

004: TAN; 25

005: x²; 43, 11

006: STO 1; 44, 1

007: 6; 6

008: 3; 3

009: 7; 7

010: 8; 8

011: . ; 48

012: 1; 1

013: 3; 3

014: 7; 7

015: STO 2; 44, 2

016: 4; 4

017: 14; y^x

018: 6; 6

019: 3; 3

020: 5; 5

021: 6; 6

022: . ; 48

023: 7; 7

024: 5; 5

025: 2; 2

026: 3; 3

027: 1; 1

028: 4; 4

029: 2; 2

030: STO 3; 44, 3

031: 4; 4

032: y^x; 14

033: RCL 1; 45, 1

034: ×; 20

035: +; 40

036: RCL 2; 45, 2

037: x²; 43, 11

038: RCL 3; 45, 3

039: x²; 43, 11

040: RCL 1; 45, 1

041: ×; 20

042: +; 40

043: ÷; 10

044: √; 11

045: RTN; 43, 32



TI-60 Code: Earth’s Radius by Latitude

Step; Key; Key Code



Set degrees mode before beginning.



00: DMS-DD; 39

01: TAN; 34

02: x²; 96

03: STO; 61

04: 1; 01

05: ( ; 53

06: 6; 06

07: 3; 03

08: 7; 07

09: 8; 08

10: . ; 93

11: 1; 01

12: 3; 03

13: 7; 07

14: STO; 61

15: 2; 02

16: y^x; 45

17: 4; 04

18: +; 85

19: 6; 06

20: 3; 03

21: 5; 05

22: 6; 06

23: . ; 93

24: 7; 07

25: 5; 05

26: 2; 02

27: 3; 03

28: 1; 01

29: 4; 04

30: 2; 02

31: STO; 61

32: 3; 03

33: y^x; 45

34: 4; 04

35: ×; 25

36: RCL; 71

37: 1; 01

38: ) ; 54

39: ÷; 55

40: ( ; 53

41: RCL; 71

42: 2; 02

43: x²; 96

44: +; 85

45: RCL; 71

46: 3; 03

47: x²; 96

48: ×; 65

49: RCL; 71

50: 1; 01

51: ) ; 54

52: = ; 95

53: √; 86

54: R/S; 13

55: RST; 22



Examples



Latitude: 80° 00’; Radius (km): 6357.402412

Latitude: 57° 24’; Radius (km): 6362.996788

Latitude: 43° 40’; Radius (km): 6367.986902

Latitude: 9° 15’; Radius (km): 6377.588959

Latitude: 2° 56’; Radius (km): 6378.081467


Source


Planetcalc. “Earth Radius by Latitude (WGS 84)” Timur. 2021. https://planetcalc.com/7721/ Retrieved March 22, 2026.



Eddie


All original content copyright, © 2011-2026. 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.

Spotlight: HP 16C Collector’s Edition

  Spotlight: HP 16C Collector’s Edition Quick Facts: HP 16C Collector’s Edition Model: HP 16C Collector’s Edition Company: ...