BUG? or my missunderstanding: Number display

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
mcc
Posts: 215
Joined: Fri Jun 23, 2017 3:10 am

BUG? or my missunderstanding: Number display

Post by mcc » Sat Feb 24, 2018 1:04 pm

Hi,

numbers of the same magnitude are displayed differently while using the same display/mode settings.

How to reproduce:
Set DISP to:
ALL
RDX.
Set MODES to:
DEG
RECT
QUIET
CRES
KEY
Settings not shown here are not activated.

Enter:
CLST
34
55
/
5
SQRT
1
-
2
/

The result shown is:
Y: 6.18181818182e-1
X: 0.61803398875

Background: There is an OFFIMG which shows the "Fibonacci Spiral" and I wanted to determine (just for fun) what the delta is between the value shown with the spiral and the "real golden cut...the most irrational number of the universe" :)

Both numbers are of the same magnitude.
Both are the results of arithmetic calculations.
And both are displayed differently.
I dont understand, why.....
And if there is no reason, this may be a bug.
Tested with my DM42 with firmware 3.3

Cheers
Meino
DM 42 - SN: 00373, Firmware release v.:3.18. / 3.18. as compiled by SwissMicros

rprosperi
Posts: 869
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: BUG? or my missunderstanding: Number display

Post by rprosperi » Sat Feb 24, 2018 2:48 pm

mcc wrote:
Sat Feb 24, 2018 1:04 pm
Both numbers are of the same magnitude.
Both are the results of arithmetic calculations.
And both are displayed differently.
I dont understand, why.....
And if there is no reason, this may be a bug.
Tested with my DM42 with firmware 3.3
The 2 numbers are not of the same magnitude, though approximately the same, but this result is interesting.

Note that a real HP-42S and Free42 (Android) both also do the same thing, so it's not a bug.
--bob p

DM42: β00071 & 00282, DM41X: β00071, DM10L: 071/100

Thomas Okken
Posts: 713
Joined: Tue May 02, 2017 3:48 pm
Location: United States
Contact:

Re: BUG? or my missunderstanding: Number display

Post by Thomas Okken » Sat Feb 24, 2018 3:16 pm

On the real HP-42S, ALL mode always shows all significant digits, in fixed-point notation if it can, and scientific notation otherwise.

The peculiarity arises from the fact that, for numbers with magnitude less than 1, it will show a zero before the decimal, and that zero counts towards the maximum of 12 digits that are shown of the mantissa.

Thus, 3 1/X shows 3.33333333333e-1, but 0.33333333333 (eleven threes) is displayed without exponent.

Since Free42 has more than 12 mantissa digits, things are slightly different, but basically, what it does is round the mantissa to 12 digits, and then it applies the 42S rules.

And so: 5 SQRT 1 - 2 /, rounded to 12 significant digits, is 0.618033988750, and because of that final zero, it can be displayed in fixed-point mode with no loss of precision compared to SCI 11 mode.

rprosperi
Posts: 869
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: BUG? or my missunderstanding: Number display

Post by rprosperi » Sat Feb 24, 2018 5:14 pm

Thomas Okken wrote:
Sat Feb 24, 2018 3:16 pm
On the real HP-42S, ALL mode always shows all significant digits, in fixed-point notation if it can, and scientific notation otherwise.
....
Thanks for the explanation Thomas. I'll bet this is one of the odd little quirks of the 42S that you didn't guess right on the first try... Who would? But with your explanation, it at least makes sense now.
--bob p

DM42: β00071 & 00282, DM41X: β00071, DM10L: 071/100

Thomas Okken
Posts: 713
Joined: Tue May 02, 2017 3:48 pm
Location: United States
Contact:

Re: BUG? or my missunderstanding: Number display

Post by Thomas Okken » Sat Feb 24, 2018 5:36 pm

rprosperi wrote:
Sat Feb 24, 2018 5:14 pm
I'll bet this is one of the odd little quirks of the 42S that you didn't guess right on the first try...
You offend me, sir! When I bought my HP-42S, lo these many years ago, I set it to ALL mode as soon as I knew it existed (i.e. within minutes), and then it was only a matter of time (very little time) before I went "WTF is this thing switching to SCI for when I do 3 1/X?"

I got a bunch of little details wrong at first, but this wasn't one of them. 8-)

rprosperi
Posts: 869
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: BUG? or my missunderstanding: Number display

Post by rprosperi » Sat Feb 24, 2018 7:12 pm

Thomas Okken wrote:
Sat Feb 24, 2018 5:36 pm
I got a bunch of little details wrong at first, but this wasn't one of them. 8-)
I salute you sir for your inquisitive nature!

There is just no knowing just what a truly OCD mind will do next, but I personally take great comfort in that! ;)
--bob p

DM42: β00071 & 00282, DM41X: β00071, DM10L: 071/100

Post Reply