[WP34S] A funny bug in Pi (prod)



#5

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


#6

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


#7

My bad. RTFM!

Thanks,
Eduardo

Quote:
You want 10.001 {PI} B.

- Pauli


#8

Compare p. 112 of the manual.

d:-)


Possibly Related Threads…
Thread Author Replies Views Last Post
  [OT] Mathematica free for Raspberry PI BruceH 32 8,420 11-23-2013, 05:24 AM
Last Post: Nick_S
  Computing pi with the PC-1300S Kiyoshi Akima 0 1,129 11-17-2013, 12:24 AM
Last Post: Kiyoshi Akima
  Prime: Exam mode (possible duplicate after funny response first time) Paul Townsend (UK) 1 1,497 10-24-2013, 03:09 PM
Last Post: Tim Wessman
  Calculating Pi LHH 9 2,892 09-27-2013, 10:50 PM
Last Post: Gerson W. Barbosa
  wp34s binomial bug Andrew Nikitin 4 1,835 09-22-2013, 05:20 PM
Last Post: Paul Dale
  Visualization of pi Bruce Bergman 13 3,727 08-17-2013, 05:00 PM
Last Post: Howard Owen
  Expon bug in wp34s Andrew Nikitin 7 2,284 07-14-2013, 03:23 AM
Last Post: Marcus von Cube, Germany
  another wp34s bug Andrew Nikitin 8 2,558 06-26-2013, 01:01 AM
Last Post: Paul Dale
  weird statistics bug in wp34s Andrew Nikitin 5 2,159 06-20-2013, 01:54 PM
Last Post: Namir
  OT: Happy Pi Day! Eddie W. Shore 13 3,789 03-22-2013, 10:44 AM
Last Post: Les Koller

Forum Jump: