Post Reply 
Could someone do a calculation on an actual calc for me please?
03-18-2015, 07:10 AM
Post: #8
RE: Could someone do a calculation on an actual calc for me please?

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.

Enjoy 'real' math!
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
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)