HP Forums

Full Version: wp34s, another shutdown situation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Here is how to reproduce:
64 MODE DENMAX DENFAC -- fractions of an inch mode

Start 'TRI' solver from library. (I did it trough CAT, select LBL'TRI', XEQ, in case that matters).

"Trigon" : [R/S]

a= : 6.1.2 [R/S]

b= : 4.7.8 [R/S]

c= : 6 [R/S]

alpha= : 0 [R/S]

beta= : 0 [R/S]

gamma= : 0 [R/S]

Solution: [R/S]

-- and calculator shuts down.

This happens on real device every time, did not try on emulator, both my calculators do that. The one with newer firmware blinks "Bye...", so it must be a "proper" shutdown.

It may or may not be related to
LINESQ step through bug, which also shuts down the calculator.

Thanks for this. We will investigate once Marcus returns from his holiday.

- Pauli

This shutdown doesn't happen on the emulator (3407). AFAICS the program runs flawless there.


I suspect this and the earlier one are related to error handling. Further investigation prove this or otherwise, however Marcus is in the best position to determine the root cause at present.

- Pauli

Here everything also works fine on "the real thing" with firmware 3.2 3405 (incl. printer/timer support).

XEQ"TRI"    TriGon
[R/S] a=
6.1.2 [R/S] b=
4.7.8 [R/S] c=
6 [R/S] alpha=
[R/S] beta=
[R/S] gamma=
[R/S] Solution:
[R/S] a= 13/2
[R/S] b= 39/8
[R/S] c= 6/1
[R/S] alpha= 106036/1461 (= 72,57768...)
[R/S] beta= 455593/9971 (= 45,69180...)
[R/S] gamma= 444151/7195 (= 61,73050...)
[R/S] P= 139/8 (= 17,375)
[R/S] A= 64091/4593 (= 13,95406...)
Calling the program via CAT and XEQ (or ENTER) does not make a difference. No errors here.


Dieter, are you sure you set both DENMAX=64 and DENFAC?
From the format of the answers it does not look that way.

The effect can be seen when the above settings are set and not in a "regular" fraction mode.

Edited: 16 June 2013, 10:00 p.m.

Looks like DENFAC contains the root cause. The error does neither happen with DENANY nor DENFIX on the "real thing" (3.2 3407).


Edited: 17 June 2013, 12:35 a.m.

No, I obviously overlooked that detail. With these settings I can reproduce the error. Seems to be something in the fractions settings.

One more reason for the metric system. ;-)


I'm pretty sure the GCD algorithm used to reduce the terms to their lowest form is the problem. It uses a huge number of digits to guarantee correct results for gcd(max-real, min-real). I think this is causing the volatile stack to overflow into important stuff. As a top level operation there is space for this, but not when called from a long chain from the display handler.

I made a change last night to just use the smaller modulus function instead but this isn't ideal since the GCD and LCM user functions will break for some inputs.

- Pauli

Maybe fraction display code could use special (internal) GCD/LCM version. It only needs to work with integers under 9999. Unlike generic function that has to deal with entire range.

More code would be required. Flash is full.

- Pauli