05-07-2021, 09:13 AM
Using the below code with the following parameters:
1900 in register 3
-31.24 in register 2
8600 in x
the value in x before the conditional test X>Y? (f TEST 7) is 894.4946 and the value in y is 1.
The test should therefore test positive and the GTO .0 should be executed.
It isn't however.
Any hints what I am missing / doing wrong would be appreciated. I have verified that Y=1 using an R/S before the conditional.
P.S.: This is a correction for minimum safe heights for aircraft to account for low temperature taken from the draft of the new PANS-OPS (where a wrong formula has been published for decades). Therefore all altitude related values are in feet but temperatures are C/K.
1900 in register 3
-31.24 in register 2
8600 in x
the value in x before the conditional test X>Y? (f TEST 7) is 894.4946 and the value in y is 1.
The test should therefore test positive and the GTO .0 should be executed.
It isn't however.
Any hints what I am missing / doing wrong would be appreciated. I have verified that Y=1 using an R/S before the conditional.
P.S.: This is a correction for minimum safe heights for aircraft to account for low temperature taken from the draft of the new PANS-OPS (where a wrong formula has been published for decades). Therefore all altitude related values are in feet but temperatures are C/K.
Code:
HP 15C
parameters:
ISA Deviation STO 2
Temperature Source Elevation STO 3
Height to be corrected in X
LBL A
STO 1 'temporary store height to be corrected in 1
.0019812 'L0
STO 0 'goes to 0
288.15 'T0
STO .0 'goes to .0
CLx clear Height correction (Hac) for initial calculation
LBL .0
ENTER 'duplicate height correction
1 'add 1
+
X<>Y 'move last height correction +1 to Y
RCL +1 'add MDH to H_ac on stack
RCL *0 'multiply by L0
RCL 3 'recall Elev
RCL *0 'multiply by L0
RCL +.0 'add T0
/
1
+
LN
RCL 2 'Delta Tstd
CHS '-Delta Tstd
RCL /0 'divided by L0
*
X>Y? 'if new correction is more than previous + 1
GTO .0 'repeat calculation with new correction value
R/S 'if not, stop and show correction'