Here is a little RPN calculator I made for the PicoCalc. It just a little different from the HP calculators in that you have to hit ENTER after keying in every number and command and function. That is because of the INPUT command I used to inter the data and functions. I wrote it in MMBasic so it is easy to modify if you want to add any more functions. Below is a formula for calculating the mach number for a jet.
Given a pressure altitude of 25,500 feet and a calibrated airspeed of 350 knots, the following formula calculates the Mach number of the aircraft:
(5[({[(1+0.2[350/661.5]^2)^3.5-1][1-(6.875*.000001)25500]^(-5.2656}+1)^0.286-1])^0.5
= 0.84 Mach number
Try using this formula on an algebraic calculator and then on a RPN calculator. Remember, on the RPN calculator you want to start inside the ()’s and work your way out. The answer is 0.84 Which do you prefer? - Jim
Option EXPLICIT
Dim STACK(6), Value, A, B, RESULT As FLOAT
Dim I As INTEGER
Dim AAA$, c, q As STRING
For I = 1 To 6
STACK(I) = 0
Next I
Do
Cls
Print " < RPN Calculator >"
Print
Print " Enter a number or operator:"
Print " (+ - * / ^ sin cos tan {Deg})"
Print " (c to Clear Stack, q to Quit)"
Print
Print
Print " T > "; Stack(4)
Print
Print " Z > "; Stack(3)
Print
Print " Y > "; Stack(2)
Print
Print " X > "; Stack(1)
Print
Input " > > "; AAA$
If AAA$ = “q” Then Exit Do
EndIf
If AAA$ = “c” Then
For I = 1 To 6
STACK(I) = 0
Next I
EndIf
Value = Val(AAA$)
If Value <> 0 Then
For I = 6 To 2 Step -1
STACK(I) = STACK(I-1)
Next
STACK(1) = Value
EndIf
If AAA$="+“Or AAA$=”-“Or AAA$=”*“Or AAA$=”/“Or AAA$=”^"Or AAA$="sin"Or AAA$="cos"Or AAA$="tan"Then
Select Case AAA$
Case “+”
RESULT = STACK(2) + STACK(1)
Case “-”
RESULT = STACK(2) - STACK(1)
Case “*”
RESULT = STACK(2) * STACK(1)
Case “/”
If STACK(1) <> 0 Then
RESULT = STACK(2) / STACK(1)
Else
Print “Division by zero!”
Pause 2000
Continue DO
EndIf
Case “^”
RESULT = STACK(2)^STACK(1)
Case “sin”
RESULT = Sin(Rad(STACK(1)))
Case “cos”
RESULT = Cos(Rad(STACK(1)))
Case “tan”
RESULT = Tan(Rad(STACK(1)))
End Select
For I = 2 To 5
STACK(I) = STACK(I+1)
Next I
STACK(6) = 0
STACK(1) = RESULT
EndIf
Loop