Post Reply 
41 MCODE - Dynamic FIX Mode
02-12-2015, 07:46 PM (This post was last modified: 02-12-2015 07:48 PM by Ángel Martin.)
Post: #1
41 MCODE - Dynamic FIX Mode
Recently I started to poke around the I/O Service interrupt, it was long overdue - it is intimidating to say the least - but Rabin Ezra's excellent article ("Direct key Synthetics, DataFile V6 N.3 pg 21-24) provided a great help.

The first practical use has been for the RCL math extensions in the SandMath: the six functions can now be triggered directly from the standard RCL, simply pressing the corresponding arithmetic key (+,-,*,/, ^, Alpha) - a real breeze; no need to have a dedicated launcher or USER mode active since there are no key assignments needed.

I've spent much more time than I anticipated with the I/O Service interrupt - in hindsight it's not surprising, such is the nature of the MCODE beast. It really is a bear to handle, so many possible combinations… not only you need to know the right questions to ask, but also when (i.e. the sequence in which) to ask them!

BTW I think I'm after a nice enhancement: would you see any value in having the calculator display only the significant decimal digits all the time? In other words, like a dynamic FIX setting that would adjust itself depending on the number to show: FIX zero for integers, fix 3 if all digits after the 3rd. are zero… etc. For me the value is in the rule "if you don’t see it, it's not there", but admittedly it isn't more than a cosmetic thing. I have it now 90% perfect, but the remaining 10% is challenging; let me know if you're curious to try it.

'AM

PS. Is this the same as the FIX ALL in the 34S? I must admit I never read that part of the manual...

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
02-12-2015, 09:32 PM (This post was last modified: 02-12-2015 09:33 PM by Dieter.)
Post: #2
RE: 41 MCODE - Dynamic FIX Mode
(02-12-2015 07:46 PM)Ángel Martin Wrote:  BTW I think I'm after a nice enhancement: would you see any value in having the calculator display only the significant decimal digits all the time? In other words, like a dynamic FIX setting that would adjust itself depending on the number to show: FIX zero for integers, fix 3 if all digits after the 3rd. are zero… etc.

Sounds like you just reinvented the wheel. ;-) This "dynamic FIX mode" seems to be the STD mode on later HPs. Or the one and only display mode of the original HP35. Or similar to the standard ALL mode in recent calculators.

Such a mode can be quite tricky. For instance, what do you do with x=1/30? The 41's display is too small for 0,03333333333 so two digits have to be dropped. How many lost digits are accepted then? And which is better: 0,000333333 or 3,333333 –04 – ask Pauli about the 34s ALL mode. ;-)

(02-12-2015 07:46 PM)Ángel Martin Wrote:  PS. Is this the same as the FIX ALL in the 34S? I must admit I never read that part of the manual...

The 34s has an ALL mode, but it is configurable as is accepts an argument: ALL 3 means that 1/300 still is displayed as 0,00333333333 but 1/3000 switches to scientific notation (3,33333333333 –4).

And BTW yes, I would consider such a display mode very useful – I always missed it on the '41.

Dieter
Find all posts by this user
Quote this message in a reply
02-12-2015, 09:56 PM
Post: #3
RE: 41 MCODE - Dynamic FIX Mode
(02-12-2015 09:32 PM)Dieter Wrote:  Such a mode can be quite tricky. For instance, what do you do with x=1/30? The 41's display is too small for 0,03333333333 so two digits have to be dropped. How many lost digits are accepted then? And which is better: 0,000333333 or 3,333333 –04 –

Yes it's tricky, and obviously won't be capable of overcoming the limitations in the machine's numeric range - but is it good enough to select the best option within the available choices. For instance in the example you mention it'll display the number using FIX 9, or 0,033333333 ; which is as much as the coconut can say about that. The displaying is the rounded value to the FIX setting, not truncated of course.

For a couple of interesting examples, try:

2, SQRT, X^2 to see 1,999999999 (so far so good), and
1, E^X, LN to see 1,000000000 *instead* of just "1" - meaning there is a tenth digit in the mantissa (even if not shown) that isn't zero.

Hey, I may be reinventing the wheel but I'm also having a ball in so doing ;-)

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
02-13-2015, 04:10 PM
Post: #4
RE: 41 MCODE - Dynamic FIX Mode
(02-13-2015 09:52 AM)Geir Isene Wrote:  When you get repeating digits other than 0, could any repetition after the 3rd digit be rounded?

That's a secondary level of sophistication - I'm still in the weeds trying to get the floating FIX (coined a new name) to work without glitches.

The boundary conditions are important, such as it needs to be 100% compatible with the CCD-style IO/SCV usage. This is tricky, as it prevents using more general interrupt conditions which would preempt (and steal) the event. So I'm using return addresses and keycodes instead to determine triggering cases...

It's almost perfect now, very smooth operation for native functions and SandMath functions as well. Also checked compatibility with the Time module, all looking good...

The Floating FIX mode is selectable, so won't be forced on all users. A flag in buffer#9 holds the enable/disable setting - the default is OFF.

I'm getting very fond of this, knowing that the now-shown digits are irrelevant it's more than cosmetic IMHO.

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
02-13-2015, 09:58 PM
Post: #5
RE: 41 MCODE - Dynamic FIX Mode
Have you seen this thread about a similar topic?

http://www.hpmuseum.org/forum/thread-3029.html

Greetings,

Matthias


--
"Programs are poems for computers."
Find all posts by this user
Quote this message in a reply
02-13-2015, 10:27 PM (This post was last modified: 02-14-2015 06:55 AM by Dieter.)
Post: #6
RE: 41 MCODE - Dynamic FIX Mode
(02-13-2015 04:10 PM)Ángel Martin Wrote:  The Floating FIX mode is selectable, so won't be forced on all users. A flag in buffer#9 holds the enable/disable setting - the default is OFF.

Hm.... unlike FIX mode, the number of digits in this new mode is not fixed. So I think it should not be called "dynamic" or "floating" FIX – if it's "dynamic" it's not fixed. ;-) Something like FLOAT or even the common STD resp. ALL seems more appropriate to me.

I would like to ask a very dumb question now (sorry, I am by no means an expert in MCODE or other internal 41-stuff). The 41 usually reflects its display mode in flags 40 and 41. Both clear means SCI, and the one or the other set stands for FIX resp. ENG mode. Is there a way for the user to test your new display mode in a similar way? I first thought of the (usually) not supported combination of both flag 40 and 41 set, but this is already used for the (not officially supported) FIX/ENG mode. ;-) Now I wouldn't be surprised if an MCODE function that returns the current display mode already existed.

(02-13-2015 04:10 PM)Ángel Martin Wrote:  I'm getting very fond of this, knowing that the now-shown digits are irrelevant it's more than cosmetic IMHO.

Yes, sure it's much more than "cosmetic". That's why I use the WP34s in ALL 3 mode most of the time. I also like the 35s' ALL mode (despite its shortcomings), for instance it allows to simultaneously return an integer (without annoying trailing zeroes) and a real (with fractional part) in its two line display. So thumbs up for something similar on the '41.

Dieter
Find all posts by this user
Quote this message in a reply
02-14-2015, 07:33 AM
Post: #7
RE: 41 MCODE - Dynamic FIX Mode
Hi Ángel!

If this thread was meant to be kind of a poll for a standard or "dynamic FIX" display, I'd say: Yes!
A feature where repeating patterns of decimal ratios were shorten would be nice too. But I am not sure if the effort was worth its while.

Cheers
Frido
Find all posts by this user
Quote this message in a reply
02-14-2015, 01:30 PM
Post: #8
RE: 41 MCODE - Dynamic FIX Mode
(02-14-2015 07:33 AM)Frido Bohn Wrote:  If this thread was meant to be kind of a poll for a standard or "dynamic FIX" display, I'd say: Yes!
A feature where repeating patterns of decimal ratios were shorten would be nice too. But I am not sure if the effort was worth its while.

Glad to see more folks are interested. The project is almost ready now, at leasy the first version - without the frill you and Geir have mentioned. Incidentally I'm not even sure I understand why such further rounding would be desired, probably me being obtuse.

As I said part of the implementation problems comes from the criteria to make it compatible with the OS/X and CCD-style functionality - also using the I/O_SVC interrupt. I for one don't want to trade the Floating FIX for my CAT"+_ , ASN / XEQ:_ _ _:_ __ and direct synthetics entry; no sir - it's got to be both, and regardless of the plugging sequence of the modules.

That means there will likely be some instances when the optimal FIX won't kick in, for instance right after STO nn - using numbers for nn as opposed to the shortcut keys. But again, a no-compromises approach (like that one implemented in the AECROM for instance) will conflict with the compatibility criteria.

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
02-14-2015, 01:36 PM
Post: #9
RE: 41 MCODE - Dynamic FIX Mode
(02-13-2015 10:27 PM)Dieter Wrote:  Hm.... unlike FIX mode, the number of digits in this new mode is not fixed. So I think it should not be called "dynamic" or "floating" FIX – if it's "dynamic" it's not fixed. ;-) Something like FLOAT or even the common STD resp. ALL seems more appropriate to me.

I realize the ALL name is what HP called it for the 35s and probably other calcs, but to me it's not a good choice. ALL what? To me ALL indicates the totality of available available, not all meaningful digits... perhaps "ALL NEEDED" - but that's too long of course.

Funny I had never realized this was implemented on the35s - so you are right I have re-invented the wheel :=O

"To live or die by your own sword one must first learn to wield it aptly."
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)