Ticket #551 (Fixed)Wed Jun 22 15:21:42 UTC 2022
SciCalc +/- bug
Reported by: | Stuart Painting (5389) | Severity: | Minor |
Part: | RISC OS: Application | Release: | |
Milestone: | Status | Fixed |
Details by Stuart Painting (5389):
SciCalc has a problem with the +/- key on very small numbers (e.g. those displayed as 1E-5).
For example:
Enter 1 / 1000000 =
The display will show 1E-6
Press +/-
The display will show 0 (instead of -1E-6)
Press +/- again
The display will now show -6
Witnessed with SciCalc 0.87 (RISC OS 5.24) and SciCalc 0.90 (RISC OS 5.29).
Similar – but not identical – results can be also obtained with SciCalc 0.46 (RISC OS 3.11) and SciCalc 0.55 (RISC OS 3.71).
Changelog:
Modified by Stuart Painting (5389) Wed, June 22 2022 - 20:41:43 GMT
I think I’ve found it.
Lines 7-11 of PROCcalc_sign (lines 814-818 of !RunImage) are:
IF INSTR=0 THEN Entry$=“-”+Entry$ ELSE Entry$=RIGHT$(Entry$,LEN-1) ENDIFThis needs to change to:
IF INSTR=1 THEN Entry$=RIGHT$(Entry$,LEN-1) ELSE Entry$=“-”+Entry$ ENDIFWe now check the leftmost character of the string to see if it is a minus sign, rather than looking for the absence of the minus sign (which can get fooled by a minus sign in the exponent).
Modified by Stuart Painting (5389) Wed, June 22 2022 - 20:44:48 GMT
- Attachment added: musings.txt
I forgot that code snippets get mangled. Here it is as a text attachment.
Modified by Stuart Painting (5389) Mon, June 27 2022 - 09:02:09 GMT
- Status changed from Open to Fixed
Fixed in SciCalc 0.91