The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[WP34S] A funny bug in Pi (prod)
Message #1 Posted by Eduardo Duenez on 27 Jan 2013, 11:33 p.m.

Hi,

I was using my 34S flashed to recent 3350 calc-full.bin

I had never used the sum (Sigma) and product (Pi) functions.

I coded the identity function f(x)=x trivially:

LBL B
RTN

Then I tried adding 1+2+...+10 with Sigma:

1
[ENTER]
10
[SIGMA]
B

Output: 55 (correct).

Then tried to find 10! instead

1
[ENTER]
10
[PI]
B
Output: 0 (should be 10!=3628800)

There is a funny bug in the implementation of PI (product), but not in SIGMA.

Cheers,

Eduardo

      
Re: [WP34S] A funny bug in Pi (prod)
Message #2 Posted by Paul Dale on 28 Jan 2013, 3:29 a.m.,
in response to message #1 by Eduardo Duenez

Both of these functions take one argument from the stack which is a loop index for the DSL instruction. In both cases you are summing/multiplying from 0 to 10 not 1 to 10.

You want 10.001 {PI} B.

- Pauli

            
Re: [WP34S] A funny bug in Pi (prod)
Message #3 Posted by Eduardo Dueñez on 28 Jan 2013, 12:38 p.m.,
in response to message #2 by Paul Dale

My bad. RTFM!

Thanks, Eduardo

Quote:
You want 10.001 {PI} B.

- Pauli


      
Re: [WP34S] A funny bug in Pi (prod)
Message #4 Posted by Walter B on 28 Jan 2013, 3:41 a.m.,
in response to message #1 by Eduardo Duenez

Compare p. 112 of the manual.

d:-)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall