Could someone do a calculation on an actual calc for me please?
03-18-2015, 07:10 AM
Post: #8
 cyrille de brĂ©bisson Senior Member Posts: 1,047 Joined: Dec 2013
RE: Could someone do a calculation on an actual calc for me please?
Hello,

Whether you do it in CAS or home, you will NOT get 0. The obvious reason is that SIN(PI)=0 by formal definition, but 3.14159.... is NOT PI, but an approximate value and the calculator returns to you the best approximation that it can find of the value of SIN(Value close to PI).

Home does calculations in BCD (Decimal), CAS uses Doubles (actually, low precision Double, Double with 8 bit of precision gone for some internal reasons).

The algorithms are different because they use different representations of the numbers.
in BCD, what you see is what you get. 3.14159265359 is slightly bigger than the real PI, thus returning a small negative number.
In Binary, the number that you see is NOT the real number in the system as binary numbers are represented as a sigma(Digitn*1/2^n) where Digitn can be a 0 or a 1. In the case of Prime, 45 bits.
1/2^45 needs >40 digits to be represented correctly in decimal. Obviously, the CAS screen does not display 40 digits numbers. So what you see on the screen is only an approximation of the real internal number. In our case, from looking at the result of sin(aprox(pi)), you can see that this number must be smaller than the real PI as the result is >0.
Note that the calculator uses a different CPU than a PC. The PC has a floating point coprocessor for doing such things in hardware while the calculator uses a SW algorithm to do the calculations. The net result, sin(aprox(pi)) in CAS returns a different result on the PC than on the calculator!

This is NOT a bug, this is as expected when using floating points numbers 'to their limits' on various different systems.

Cyrille,
Enjoy 'real' math!
 « Next Oldest | Next Newest »

 Messages In This Thread Could someone do a calculation on an actual calc for me please? - zeno333 - 03-17-2015, 04:00 PM RE: Could someone do a calculation on an actual calc for me please? - ThomasA - 03-17-2015, 04:19 PM RE: Could someone do a calculation on an actual calc for me please? - zeno333 - 03-17-2015, 04:26 PM RE: Could someone do a calculation on an actual calc for me please? - zeno333 - 03-17-2015, 05:16 PM RE: Could someone do a calculation on an actual calc for me please? - Daniel - 03-17-2015, 04:48 PM RE: Could someone do a calculation on an actual calc for me please? - dbbotkin - 03-17-2015, 05:08 PM RE: Could someone do a calculation on an actual calc for me please? - Tim Wessman - 03-17-2015, 05:28 PM RE: Could someone do a calculation on an actual calc for me please? - cyrille de brĂ©bisson - 03-18-2015 07:10 AM

User(s) browsing this thread: 1 Guest(s)