|HP50g Bug - Troubling|
Message #1 Posted by MikeO on 4 Sept 2008, 2:31 a.m.
I believe I've found a bug on the HP50g, and I'm hoping others can confirm this.
The calculator is in the following mode (non-approx mode):
DEG XYZ HEX C= 'X'
The program is entered into 'GSP' variable as follows (replace SQR with square root symbol):
<< -> V A W B << 'SQR(W^2+V^2-2*W*V*COS(180-B+A))' EVAL >> >>
I enter the following values onto the stack and execute GSP:
The calculator hangs. After a second or two, I press CANCEL, and the stack is filled with garbage.
If I switch the calculator to approximate mode:
DEG XYZ HEX C~ 'X'
Then, the program returns a correct result: 396.48
I entered the same program into 'GS2' in full RPN-style (again, replace SQR with the square root symbol):
<< -> V A W B << 180 B - A + COS W * V * 2 * NEG V SQ + W SQ + SQR >> >>
I can run this program in either approximate or exact modes without problems.
It appears to be some sort of problem parsing the algebraic expression in the first program example; however, the problem didn't become apparent until I entered the exact test input above. If 180 - B + A = 45, the program crashes.
I'm hoping someone can reproduce the problem.
Edited: 4 Sept 2008, 2:36 a.m.