The Museum of HP Calculators


Quadratic Equation program for the 32S(II)

This program is Copyright © 2002 by Pascal Fellerich and is used here by permission.

This program is supplied without representation or warranty of any kind. Pascal Fellerich and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

Usage: XEQ E, enter A, R/S, enter B, R/S, enter C, R/S. The roots are returned on the stack. The program will halt with a SQRT(NEG) message if b2-4ac is negative - so reals only. Written by myself. I tried to optimize the program by using equations for subexpressions, but the result was always larger in size and slower in execution.

Program

E01 LBL E
E02 INPUT A
E03 INPUT B
E04 INPUT C
E05 2
E06 STO× A
E07 RCL B
E08 x2
E09 2
E10 RCL× A
E11 RCL× C
E12 -
E13 PSE
E14 √x
E15 STO D
E16 RCL- B
E17 RCL÷ A
E18 RCL D
E19 +/-
E20 RCL- B
E21 RCL÷ A
E22 RTN
33 bytes, CHK=FE13

Go back to the software library
Go back to the main exhibit hall