I've written a program on my TI-84 Plus Silver Edition, and I'm having a little bit of trouble wit a bug, but this bug seems to be with the calculator, not with my program. In the program, some calculations are performed on the entered data, and the result of these calculations is stored in the variable S. If the data was entered correctly, S should equal the variable F. Here's an example of the problem, although it varies depending on what data has been entered:
The program checks if S does not equal F as part of an if statement. Instead of working, it says "ERR: DATA TYPE". I know for a fact that S and F should be equal, because the data was entered correctly.
I go to check the values of each of the variables to see what went wrong, and when I check what they equal, they both appear to equal 30.
However, when I perform the operation S minus F, the answer is 2.4E-11.
Apparently the variable displays as 30, but when operations are performed with it, its value is actually 30 plus 2.4*10^-11. The variable should equal 30, but it's slightly off, probably due to the calculator not carrying to enough decimal places in its calculations, or maybe due to rounding errors on the calculator while performing operations.
This bug can be replicated by storing the answer to 1+2.4*10^-11 as a variable, and then subtracting one from that variable. To see this, enter the following into your calculator:
1+2.4E-11 STO> A A-1
The bigger issue is that it doesn't work when you try it with the operators from the test menu (like =, does not equal), it will return an error. To see this, enter the following into your calculator:
1+2.4E-11 STO> A 1 STO> B A=B
An error should appear.
How do I fix this, or work around it?