HP Forums
(12C Platinum) Temperature Converter - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (12C Platinum) Temperature Converter (/thread-12028.html)



(12C Platinum) Temperature Converter - Gamo - 12-26-2018 11:07 AM

Program to convert temperature between (°C <--> °F)

Procedure: FIX 1

0 for (°C --> °F)
1 for (°F --> °C)

37°C
0 ENTER 37 [R/S] display 98.6 // Answer °F

212°F
1 ENTER 212 [R/S] display 100.0 // Answer °C

------------------------------------------------------

Program: (ALG Mode)
Code:

STO 0
X<>Y
X=0
GTO 015
RCL 0 - 32 x 5 ÷ 9 =
GTO 000
RCL 0 x 9 ÷ 5 + 32 =

Gamo


RE: (12C Platinum) Temperature Converter - Dieter - 12-26-2018 04:05 PM

(12-26-2018 11:07 AM)Gamo Wrote:  Program: (ALG Mode)
Code:
STO 0
X<>Y
X=0
GTO 015
RCL 0 - 32 x 5 ÷ 9 =
GTO 000
RCL 0 x 9 ÷ 5 + 32 =

May I ask two questions?

- Why does the program require a data register? Why don't you simply recall the input with another X<>Y ?

- The °F to °C conversion calculates "<input> – 32 x 5 / 9". Any decent algebraic calculator I know of would do the multiplication/division before the subtraction. Does the 12C Platinum really ignore this? So would "1+2x3=" really return 9 instead of 7 ? If the resul is (correctly) 7 the program needs parantheses or an additional "=".

Edit: reading the 12C Platinum manual, I just realized that indeed this calculator does not calculate the multiplication and division first. It simply executes the operations from left to right. Unbelievable... #-(

Dieter


RE: (12C Platinum) Temperature Converter - Albert Chan - 12-26-2018 05:38 PM

(12-26-2018 04:05 PM)Dieter Wrote:  Edit: reading the 12C Platinum manual, I just realized that indeed this calculator does not calculate the multiplication and division first. It simply executes the operations from left to right. Unbelievable... #-(

I noticed that too Big Grin

BTW, I prefer using -40 C = -40 F, to avoid remembering offset of ±32
With chained calculator:

C→F : + 40 × 1.8 - 40 =
F→C : + 40 ÷ 1.8 - 40 =


RE: (12C Platinum) Temperature Converter - ijabbott - 12-27-2018 06:50 AM

(12-26-2018 04:05 PM)Dieter Wrote:  Edit: reading the 12C Platinum manual, I just realized that indeed this calculator does not calculate the multiplication and division first. It simply executes the operations from left to right. Unbelievable... #-(

Also known as "chain mode". It seems quite common for financial calculators. The 17BII and 19BII work in the same way when set to ALG mode (i.e. it is really a chain mode), except when entering equations in the solver, where the usual order of operations is followed!

The 20b and 30b support RPN, Chain, and Algebraic modes. The 10bIi+ supports Chain and Algebraic modes.


RE: (12C Platinum) Temperature Converter - Gamo - 12-27-2018 07:29 AM

Thanks for the review to all.

One thing I like about ALG mode that it is always do operation from left to right
as Dieter mention.
This kind of operation is sometime less confuse to operate but
of cause that use a lot of programing steps. No wonder that 12C Platinum
have 400 maximum program steps to spare. Smile

Gamo