The Museum of HP Calculators

Sum Function (self-contained) for the HP-35s

This program is by Eddie W. Shore and is used here by permission.

This program is supplied without representation or warranty of any kind. Eddie W. Shore 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

This is a self-contained (one label) program to evaluate:

B
Σ f(X) = S
X=A

The sum is stored in the variable S.

To find the sum, enter A then B on the stack and execute the appropriate label (I have it under label W).

A B  XEQ W ENTER

To change or load the function, hit GTO W017. This line is where the function is stored (as an equation). X must be the dependent variable of the function. This program is made to run in RPN Mode.

Example:

10
Σ 1/X = S
X=1

Load the function:
GTO W017
RS PRGM (enter program mode)
(left or right arrow to edit the equation)
If necessary, clear the equation and type 1 ÷ RCL X or INV RCL X, then press ENTER
RS PRGM (leave program mode)

Calculate the sum:

1 ENTER 10 XEQ W ENTER (or XEQ W001 ENTER)

Result:
S = 2.928968 (FIX 6)

Listing

W001  LBL W
W002  1E3        % initialization
W003  ÷
W004  +
W005  STO I      % I acts as a counter,
W006  0          % use f(X) where X=INT(I)
W007  STO S
W008  RCL I      % loop starts here
W009  INTG
W010  STO X
W011  XEQ W017
W012  STO+ S
W013  ISG I
W014  GTO W008   % end of loop
W015  VIEW S
W016  RTN
W017  f(X) ←     enter your function here
W018  RTN