Post Reply 
WP 34S and 31S bugs and fixes
05-23-2017, 12:19 PM (This post was last modified: 05-23-2017 12:24 PM by Dieter.)
Post: #281
RE: WP 34S and 31S bugs and fixes
(05-23-2017 12:00 PM)Briancady413 Wrote:  I calculated e^(i*Pi) and got a real component of -1(as should be) plus a tiny imaginary component, which I believe shouldn't be there.

This is not a bug, it is the correct result.

Remember: pi is an irrational number with infinitely many digits. But your calculator uses only 16 resp. 34 digits, so you cannot enter pi, you can only enter a close approximation. The first 16 (or 34) digits are all you can provide. So you do not calculate e^(i*pi) but e^(i*3,141592653589793). The imaginary part of this is approx. pi – 3,141592653589793 so that you get i * 2,3846...E–16. Or switch to double precision and get i * –1,158...E–34.

The same happens if you try to calculate sin(pi). You won't get zero but again a very tiny residual. That's again because you do not calculate sin(pi) but sin(3,141592653589793) which is 2,3846 E–16.

Dieter
Find all posts by this user
Quote this message in a reply
05-23-2017, 01:18 PM (This post was last modified: 05-23-2017 01:19 PM by toml_12953.)
Post: #282
RE: WP 34S and 31S bugs and fixes
(05-23-2017 12:00 PM)Briancady413 Wrote:  I calculated e^(i*Pi) and got a real component of -1(as should be) plus a tiny imaginary component, which I believe shouldn't be there. This is on an emulator running on ubuntu 16.04.2

If it's any consolation, the HP Prime gets

−1,-2.06761537357ᴇ−13*i

Tom L
Find all posts by this user
Quote this message in a reply
05-23-2017, 05:05 PM (This post was last modified: 05-23-2017 09:31 PM by Dieter.)
Post: #283
RE: WP 34S and 31S bugs and fixes
(05-23-2017 01:18 PM)toml_12953 Wrote:  If it's any consolation, the HP Prime gets

−1,-2.06761537357ᴇ−13*i

This should be the result from any 12-digit calculator (the 35s returns the same). The imaginary part of e^(i*pi) is sin(pi), resp. here sin(3,1415926...), which is approximately pi – 3,1415926... . The 12-digit machines use "pi"=3,14159265359, so the imaginary part here is ~ pi – 3,14159265359 = –2,06761537357 E–13.

In the same way a 10-digit calculator should return pi – 3,141592654 = –4,102067615 E–10.
But since most of these calculators internally use 13 digits for pi I'd expect not more than –4,10 E–10.

Dieter

Edit: corrected the value for 10-digit devices
Find all posts by this user
Quote this message in a reply
Post Reply 




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