Re: Using the HMS functions in a user RPL program.
On Sat, 10 Dec 2005 03:42:38 -0600, Heiko Arnemann wrote:
The value 0 for number of places [to round HMS] is also not reasonable.
What's wrong with rounding to the nearest hour (or degree)?
Lawyers, in fact, seem to always round that way, although actually,
I think they tend to use the CEIL function in place of RND :)
The required program need additionaly take care,
if the user means hours, degrees or grad.
The HMS conversions and HMS arithmetic functions
are valid only for hours.mins_seconds or degrees.mins_seconds
(not angles in grads or radians), but there is no way
for the calculator to read the mind of the user,
nor even to imagine whether HMS is being used
to deal with angles or to deal with time,
(not that it matters, since the numeric operations are identical),
so inasmuch as there is no specially marked object type or unit
to distinguish the inputs or outputs of these functions,
it has to remain the user's responsibility
to decide when it's proper to use these functions,
and the calculator's responsibility
to simply carry them out whenever demanded.
Program authors, of course, can design whatever user interface
they want, but here we are only considering an HMSRND function
with which to provide them, and then leave it to them
to decide when to use it.
Once upon a time this was even the case for conversions
between Polar and Rectangular coordinates; when the
calculator objects were only real numbers,
all responsibilty fell on the programmer and user to remember
which format each pair of real numbers was supposed to mean,
but the HP48 introduced a new paradigm, which is that
a coordinate pair is contained within a single special object,
and that the pair is *always* stored in rectangular form.
However, an input parser recognizes a special syntax
to distinguish polar input from rectangular input,
and the display can present these objects in the user's choice
of polar or rectangular formats, using the same syntax,
obviating any need for the old R->P and P->R functions,
but leading many a new user to complain "hey, how come
this stupid calculator left out those standard functions?" :)
That new paradigm took care of one old ambiguity, but when
it comes to the different ways of expressing hours or degrees,
either as "straight decimal" or "with minutes and seconds,"
we are still where we used to be with Rectangular vs. Polar,
and it remains up to the user to keep mental track of what (s)he means.
I would therefore say that an HMSRND program
has exactly the same validity as any other built-in HMS function,
and must likewise just do what the user asks,
hoping that (s)he knows what (s)he is doing :)
A case strukture with the faktors 24, 360 and 400
would take care for "0", and 3600 and 60 can be applied
for the digit rounding for 1 to 3.
The format "xxxx.mmssssssssss" (as used by HMS functions)
has a hard-coded definition (that there are 60 seconds
to each minute, and 60 minutes to each degree or hour);
this definition is not adjustable in these products,
and the very fact that you elect to use an HMS function
implies your acceptance and consent to that user agreement :)
The format itself, however, inherently introduces
the possibility of specfying "mm" as 60-99
and "ss.ssssss" also in the range of 60 to 99.999999 etc.
The calculator designer could choose either to regard such
inputs as invalid and throw an exception, or to proceed
more generally to accept them and simply add together
the meanings of the three separate parts of the format,
with the given factor of 60 between each adjacent part.
Inasmuch as some of the HP ROM developers
(in financial models particularly)
were not too thoughtful in how they implemented the conversions,
allowing values of exactly 60 to appear in results,
it's sort of a good thing that they decided
not to throw an exception on input which could have been
the previous output of the very same functions :)
My microwave oven does exactly the same, by the way,
as do most of my digital countdown timers; you can specify
99 minutes, or 99 hours, or 99 seconds, and they never complain;
they just count down to zero before affecting the next
group of digits to the left (if any),
and thus they do exactly the right thing for me, the user,
who is, after all, always right :)
I suggest to challenge the user,
instead of implementing another rounding function.
If someone needs rounded results for the HMS format, to clean up
inevitable perturbations which could produce longer-looking answers,
I can see no more reason to discourage it than to discourage
the basic decimal RND function already provided.
There may be a need to improve/AddSomething To the AUR.
Yes, why not educate users of the HMS format by pointing out
that they need to take responsibility for using it properly,
that it needs a program to be properly rounded,
as well as other things such as that the HMS format
can not be properly used with the numeric solver,
as has already been illustrated in an earlier referenced post.
Well, enough of my chatting here;
I must get back to the rest of my scheduled 99 hour day :)
With best wishes from http://www.mum.edu
and http://www.maharishischooliowa.org
.
Relevant Pages
- Re: Record Duplication & Formatting Advise Please.....
... Instead of just Copy then Paste, you need to copy then Edit>Paste Special> choose Values as this will change the formulae into the absolutes of what the formulae are doing i.e. the Proper names. ... The Properfunction cannot be used in the cell with the entry itself. ... using auto correct but I wondered if this is the correct use of this feature ... I also looked at the "Proper " format, but can't seem to get it to work. ... (microsoft.public.excel) - Re: Linux vs Solaris?
... file of a standard format in which the format is not inherently aligned ... to comply with your system's addressing limitations. ... > When using proper types for your data, ... It seems you consider SIGBUS as a debugging aide. ... (comp.unix.programmer) - Re: NotInList will not allow me to modify NewData
... This may help you to understand how to use the NotInList event: ... > "in the format Last Name, First Name.", vbExclamation Or vbSystemModal, ... > If I don't use the proper format I get the ... > I have tried using acDataErrContinue but I still get the NotInList ... (microsoft.public.access.formscoding) - Re: Month only field problem
... reports are fiscal year, some calendar. ... names alphabetically so assigning a number value should keep it in the proper ... calendar order. ... >>field size is long interger and Format is mmmm. ... (microsoft.public.access.tablesdbdesign) - Re: Land Survey Program
... f->DISPLAY (orange shifted left arrow key) ... If you have a value in one format, and then select the other format from the ... DISPLAY menu, the values in the registers are converted. ... Rectangular on the value in the X-register. ... (comp.sys.hp48) |
|