Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hours (Degrees), Minutes, Seconds

18 views
Skip to first unread message

John H Meyers

unread,
Jun 28, 2000, 3:00:00 AM6/28/00
to
This is about: ->HMS HMS-> HMS- HMS+

I thought HP had figured this all out way back when;
after all, the ancient HP15C converts 1/3 hour (0.3333333333)
to 20 minutes (0.2000000000), so why does the newer HP17BII
which I just acquired decide that HMS(.333333333333)
should give a result of 0.196000000000 -- these are not
just rounded results in the display, mind you; these are all
the "full precision" results (revealing all mantissa digits).

While it's true that 19 minutes + 60 seconds = 20 minutes,
this doesn't look quite like an "HP-style" result,
if you know what I mean; it's more like the contractor
who left me a kitchen table top and some nails,
and said "just get a hammer and bang them in --
you can finish it up yourself" :)

My HP48G (rev M) manages to convert .333333333333 hours to
the good old 0.200000000000 in hh.mmss format, but try these:

1. .595999999999 HMS- ==> 1.00044E-12

1. .595999999999 HMS+ ==> 1.60 (exactly, once again)

My HP48GX(R) is still bathing in the liquid effluent of some
Ray-O-Vac "alkaline maximum" batteries which burst forth in
generous profusion, but by golly, my HP49G (rev 1.17-6 -- I'm
not even a "frequent flasher" these days) gives instead the exact
correct results for the above, which we should have applauded,
if we weren't too preoccupied with the CAS to even notice :)

Evidently, it must have been hard to do these things right
in SysRPL, in certain models of HP calcs, but it's curious
that it's not hard to do it quite well with either UserRPL or
straightforward formulas, without any such anomalous answers
(you can use these formulas in your HP18C, if you have one):

->HMS

Program: \<< DUP FP .4 * - DUP 100. * FP .004 * - \>>

Formula: H.MS=H.-FP(H.)*.4-FP((H.-FP(H.)*.4)*100)*.004


HMS->

Program: \<< DUP 100. * FP 150. / + DUP FP 1.5 / + \>>

Formula: H.=H.MS+FP(H.MS*100)/150+FP(H.MS+FP(H.MS*100)/150)/1.5

Note that there exist "improper" inputs for .mmss for which
the HMS-> result comes out 2/3 of an hour too small,
namely: .9960 (100 minutes) or greater; any purists
can deal with this on their own, as I don't want to
spoil the beauty and elegance of the simple formula
by dealing with the reality of actual user input :)

I know what you're thinking -- if you have a numeric solver in your
calc, you could make do with just one of the pair of formulas,
and you could use the solver to calculate the inverse, right?

So try the H.MS -> H. formula, enter 4.085 for H.;
start with a "guess" of zero (store two equal guesses on
any HP17B/18C/19B model) and solve for H.MS; get answer: 3.6466

Well, that's like the 0.1960 answer we were admiring earlier;
you get to finish the job yourself if you want the "canonical" form:
3 hours + 64 minutes + 66 seconds = 4 hours + 5 minutes + 6 seconds !!

If you start with a single "guess" of 5.000 (store it twice on
HP17B/18C/19B models), then the root finder gets a little dizzy,
and just stops without finding a root at all!

If we try the H. -> H.MS formula instead, enter 4.0506 for H.MS,
and then solve for H., the solver will (eventually) find the root
H.=4.085; however, if we start with the non-canonical form of
3.6466 for H.MS then the solver will encounter a sign change
around H.=4.000, and will return a "false root."

Alas, here's a nut that the numeric solver just can't crack;
you need one formula (or function) to convert in one direction,
and another, distinct formula, to convert the other way!

So, take it from this experience that calculator functions
are not "magic bullets" -- you need to be well aware of
what you're doing, and use the right tools for the right job.

TI calculators don't do your thinking for you, either --
although they *do* seem to do the thinking for more teachers :)

--------

Lest any HP12C users feel left out,
here's a conversion program for you too ( H.MS <-> H. )

Line 0 1 2 3 4 5 6 7 8 9

0: 0 x<=y GTO24 Rolld ENTER FRAC . 4 *
1: - ENTER SWAP EEX 2 * FRAC 2 5 0
2: / - CHS GTO00 Rolld ENTER SWAP EEX 2 *
3: FRAC 1 5 0 / + ENTER FRAC 1 .
4: 5 / + CHS [line 43 ends program, 15 regs remain]

Since the 12C accommodates only one program, our convention here
is that positive input values will be converted H.MS -> H.
while negative input values will be converted H. -> H.MS
(we change the sign after conversion, so that you don't need to,
but if you don't want a neg. sign on output, omit the CHS at line 43).

By the way, I just filled out my "HP12C questionnaire" on the HP calc
web site; if you want to see RPN survive in future calc designs, folks,
round up your friends and do the same: Vote early -- and vote often :)

---------------------

"Time's fun when you're having flies." - Kermit the Frog

"Time is a great teacher,
but unfortunately it kills all its pupils." - Hector Berlioz

"I wasted time, and now doth time waste me." - Shakespeare

"Dost thou love life? Then do not squander time;
for that is the stuff life is made of." - Benjamin Franklin

-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu>


Sent via Deja.com http://www.deja.com/
Before you buy.

savage

unread,
Jun 28, 2000, 3:00:00 AM6/28/00
to
So, are you and the third element of << 256 MENU BetaTesting >> one in the
same?

John H Meyers <jhme...@miu.edu> wrote in message
news:8jcmjj$290$1...@nnrp1.deja.com...


> This is about: ->HMS HMS-> HMS- HMS+

[snip]

> "Time's fun when you're having flies." - Kermit the Frog
>
> "Time is a great teacher,
> but unfortunately it kills all its pupils." - Hector Berlioz
>
> "I wasted time, and now doth time waste me." - Shakespeare
>
> "Dost thou love life? Then do not squander time;
> for that is the stuff life is made of." - Benjamin Franklin
>
> -----------------------------------------------------------
> With best wishes from: John H Meyers <jhme...@mum.edu>

Nice quotes.


0 new messages