![]() |
[WP34S] A funny bug in Pi (prod) - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: [WP34S] A funny bug in Pi (prod) (/thread-237930.html) |
[WP34S] A funny bug in Pi (prod) - Eduardo Duenez - 01-27-2013 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 Then I tried adding 1+2+...+10 with Sigma:
1 Output: 55 (correct).
Then tried to find 10! instead 1Output: 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) - Paul Dale - 01-28-2013 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.
Re: [WP34S] A funny bug in Pi (prod) - Walter B - 01-28-2013 Compare p. 112 of the manual.
d:-)
Re: [WP34S] A funny bug in Pi (prod) - Eduardo Duenez - 01-28-2013 My bad. RTFM!
Thanks,
Quote: |