octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65291] [octave forge] (mapping) degrees2dms p


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #65291] [octave forge] (mapping) degrees2dms produces incorrect results
Date: Thu, 7 Mar 2024 14:34:38 -0500 (EST)

Follow-up Comment #10, bug #65291 (group octave):

Hi Anonymous,

Again, degrees2dms.m is not my code. Feel free to suggest improvements and if
we agree (I'm probably easy to convince here) they can be pushed.

What you write about angle2str.m's rounding might (partly?) have been covered
in patch #9953. At least, in my reminiscence of handling that contribution we
had some rounding issues resembling the current bug subject.
> Hopefully we agree that the output of degrees2dms must always have the
following properties (assuming finite input):
I'm not so sure anymore that minutes and seconds should overflow to degrees
and minutes, resp., if (*rounded*) they reach integer 60 (sign to be taken
into account obviously, but signs only apply to the degrees section). But they
*should* overflow if their binary representation surpasses integer 60. So
there's some room for "suggested accuracy" there beyond pure integer
representations.
Moreover, I see no reason for the smallest unit (seconds here) to be strictly
integer. That can be covered in some extra input parameter (as far as I'm
concerned we need not be limited to strictly Matlab compatibility here, we can
offer "more").
For the rest I agree.
> Regarding the other changes in the file attached to comment #2: 
Matlab's degrees2dms doesn't seem to have rigid input validation, it just uses
the int8 of uint8 values of character input (...)
> Does the `elseif (ischar (deg))` branch prevent some incorrect result, or
was it just added for clarity or to save unnecessary computation? 
Again, degrees2dms.m is not my code.

Then, you mention a d2dms function you wrote. Would you like to swap the
current mapping function's code with your code? Or amend it with your code?
I'm all open to suggestions.

BTW I plan to make a new mapping pkg release somewhere this summer. All that
is keeping me from it is switching to the Octave-packages way of doing things
("my" packages mapping and io are still at SourceForge).
So, a better degrees2dms.m would fit in the plan ...


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65291>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]