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: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #65291] [octave forge] (mapping) degrees2dms produces incorrect results
Date: Tue, 12 Mar 2024 11:34:56 -0400 (EDT)

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

here are the comment #9 outputs in Matlab 2023b:


>> format long
>> x = [Inf; -Inf; 0; -0; -0.01; -0.5; -0.51; -5; -5.01; -5.5]
x =
                 Inf
                -Inf
                   0
                   0
  -0.010000000000000
  -0.500000000000000
  -0.510000000000000
  -5.000000000000000
  -5.010000000000000
  -5.500000000000000
>> 1 ./ x
ans =
   1.0e+02 *
                   0
                   0
                 Inf
                -Inf
  -1.000000000000000
  -0.020000000000000
  -0.019607843137255
  -0.002000000000000
  -0.001996007984032
  -0.001818181818182
>> degrees2dms(x)
ans =
                 Inf                 NaN                 NaN
                -Inf                 NaN                 NaN
                   0                   0                   0
                   0                   0                   0
                   0                   0 -36.000000000000000
                   0 -30.000000000000000                   0
                   0 -30.000000000000000  36.000000000000085
  -5.000000000000000                   0                   0
  -5.000000000000000                   0  35.999999999999233
  -5.000000000000000  30.000000000000000                   0
>> 1 ./ ans
ans =
                   0                 NaN                 NaN
                   0                 NaN                 NaN
                 Inf                 Inf                 Inf
                -Inf                -Inf                -Inf
                -Inf                -Inf  -0.027777777777778
                -Inf  -0.033333333333333                 Inf
                -Inf  -0.033333333333333   0.027777777777778
  -0.200000000000000                 Inf                 Inf
  -0.200000000000000                 Inf   0.027777777777778
  -0.200000000000000   0.033333333333333                 Inf
>> degrees2dm(x)
ans =
                 Inf                 NaN
                -Inf                 NaN
                   0                   0
                   0                   0
                   0  -0.600000000000000
                   0 -30.000000000000000
                   0 -30.600000000000001
  -5.000000000000000                   0
  -5.000000000000000   0.599999999999987
  -5.000000000000000  30.000000000000000
>> 1 ./ ans
ans =
                   0                 NaN
                   0                 NaN
                 Inf                 Inf
                -Inf                -Inf
                -Inf  -1.666666666666667
                -Inf  -0.033333333333333
                -Inf  -0.032679738562092
  -0.200000000000000                 Inf
  -0.200000000000000   1.666666666666702
  -0.200000000000000   0.033333333333333




    _______________________________________________________

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]