H->HMS conversion HP-15C vs. HP42S vs HP67
09-08-2018, 06:03 PM (This post was last modified: 09-08-2018 06:08 PM by Albert Chan.)
Post: #30
 Albert Chan Senior Member Posts: 1,840 Joined: Jul 2018
RE: H->HMS conversion HP-15C vs. HP42S vs HP67
(09-07-2018 03:43 PM)Albert Chan Wrote:  Example: if angle = 2° 1' , X = 2.01 (IEEE double of 2.0099999...)

X = 2.0099999 ... --> Y = 20100.00 (scaled and rounded to hundredth of second)

DMS->DEG: (Y - 40*int(Y/100) - 2400*int(Y/10000)) / 3600 = (20100 - 8040 - 4800) / 3600 ~ 2.0166666...

Uh, I was getting stupid ...
My post #23 already have an elegant method.

Scale by 10000 (to move the troublesome decimal point), then round to 15 digits.
(approximated rounding good enough, just to catch the "40 seconds" bug)

That is all that is needed.
No reason to get precisely rounded 15 digits decimal.
 « Next Oldest | Next Newest »

 Messages In This Thread H->HMS conversion HP-15C vs. HP42S vs HP67 - Siegfried - 09-06-2018, 11:16 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - BartDB - 09-06-2018, 11:30 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Massimo Gnerucci - 09-06-2018, 11:35 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Robert VM - 09-06-2018, 12:58 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Paul Dale - 09-06-2018, 11:32 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - ijabbott - 09-06-2018, 06:51 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Thomas Okken - 09-06-2018, 10:37 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Siegfried - 09-07-2018, 09:42 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Didier Lachieze - 09-06-2018, 12:05 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Gene - 09-06-2018, 01:07 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Paul Dale - 09-07-2018, 03:40 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - rprosperi - 09-06-2018, 01:21 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - burkhard - 09-06-2018, 01:42 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-06-2018, 02:14 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Dieter - 09-06-2018, 05:01 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - burkhard - 09-06-2018, 05:14 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Dieter - 09-06-2018, 05:31 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-06-2018, 07:36 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-07-2018, 09:43 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Thomas Okken - 09-07-2018, 02:40 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-08-2018, 12:59 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Zaphod - 09-06-2018, 05:58 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - burkhard - 09-06-2018, 06:02 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Pekis - 09-07-2018, 07:07 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-07-2018, 03:43 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-08-2018 06:03 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-09-2018, 04:21 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Joe Horn - 09-09-2018, 05:10 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Carsen - 09-09-2018, 05:29 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-09-2018, 07:50 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - teenix - 09-09-2018, 08:59 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - AndiGer - 09-15-2018, 09:54 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - AndiGer - 09-07-2018, 04:57 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Gene - 09-07-2018, 08:49 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Thomas Okken - 09-08-2018, 02:35 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-08-2018, 03:45 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-09-2018, 06:13 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-09-2018, 11:39 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-09-2018, 08:51 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Thomas Okken - 09-09-2018, 01:54 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-09-2018, 03:25 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Pekis - 09-10-2018, 07:31 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-10-2018, 12:46 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Pekis - 09-10-2018, 01:31 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-10-2018, 04:28 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-12-2018, 07:14 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-12-2018, 02:08 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-12-2018, 08:20 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-14-2018, 12:46 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Joe Horn - 09-10-2018, 03:32 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-10-2018, 06:18 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Joe Horn - 09-10-2018, 06:53 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Dieter - 09-10-2018, 07:13 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Joe Horn - 09-10-2018, 07:06 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - DaveBr - 09-20-2018, 08:52 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-12-2018, 07:06 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Werner - 09-10-2018, 02:10 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-13-2018, 04:47 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Pekis - 09-13-2018, 08:47 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-13-2018, 01:46 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-18-2018, 04:56 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Pekis - 09-13-2018, 03:11 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-15-2018, 02:47 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Craig Bladow - 09-21-2018, 03:06 AM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Albert Chan - 09-21-2018, 12:16 PM RE: H->HMS conversion HP-15C vs. HP42S vs HP67 - Ken S - 09-21-2018, 06:08 AM

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