The Museum of HP Calculators

HP Forum Archive 09

[ Return to Index | Top of Index ]

pi sin() on HP-32S?
Message #1 Posted by K. Crowe on 10 Jan 2003, 8:28 p.m.

When I take the sin of pi on my HP 32S, in RAD mode, I dont get an answer of 0. The answer I get is -2.067154E-13. I also get the same answer with my 49G, but on my 30S i get exactly 0.

      
Re: pi sin() on HP-32S?
Message #2 Posted by Daniel Kekez on 10 Jan 2003, 8:39 p.m.,
in response to message #1 by K. Crowe

On my 32SII, the sine of pi is -2.06761537357e-13. Under "Answers to Common Questions" in Appendix A of the manual:

Q: Why does calculating the sine (or tangent) of pi radians display a very small number instead of 0?

A: pi cannot be represented exactly with the 12-digit precision of the calculator.

      
Re: pi sin() on HP-32S?
Message #3 Posted by Vieira, Luiz C. (Brazil) on 10 Jan 2003, 10:57 p.m.,
in response to message #1 by K. Crowe

Hi;

The HP30S is not an HP original design. The HP32S is.

As correctly mentioned by Daniel Kekez, if you compute sin(3.14159265359xxx) you should have -2.0671537357E-13 as an answer, and that's what's shown in the HP42S in FIX 11. The xxx were added to remind the HP42S works with 15 digits internally.

The HP30S answer is wrong OR uses an approximation algorithm that is not explicitly shown.

I agree with the HP32S answer. The HP30S chip designers may not care for this. And HP seems not to care, too.

Cheers.

      
Re: pi sin() on HP-32S?
Message #4 Posted by Mike Sebastian (Texas) on 11 Jan 2003, 12:17 p.m.,
in response to message #1 by K. Crowe

The HP30S appears to perform its calculations in binary, instead of BCD (Binary Coded Decimal), and appears to calculate the results of its transcendental functions to about 24 digits of precision. I believe it also utilizes a more sophisticated rounding process than that found on other calculators.

The HP30S was designed as a calculator for classroom use, and roundoff errors from normal floating point calculations can cause confusion for many students. Hence, the extended precision and more sophisticated rounding algorithms to provide "exact" answers.

For more information on the varying precision and algorithm quality of various scientific calculators, check out the calculator forensics pages on my web site.

            
Thank you.
Message #5 Posted by Vieira, Luiz C. (Brazil) on 11 Jan 2003, 1:25 p.m.,
in response to message #4 by Mike Sebastian (Texas)

Hi;

I thought seriously about removing my post, but it's a good example of what happens when you do not know actual facts.

I felt a lot bad, but I learnet some new facts.

But I still believe students should know more about precision, mostly in trigonometric computations. It's a fact that the better precision is achieved when working with more internal digits, but do the students know about what happens if only the digits shown in the display are used?

I am a teacher and I call their attention for these facts, mostly for the ones attending classes for Computing Science.

Cheers and thank you for the good posts.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall