bugGNU Octave - Bugs: bug #60647, datevec(730972.1249999999)

 
 

bug #60647: datevec(730972.1249999999)

Submitter:  Muhali <muhali>
Submitted:  Thu 20 May 2021 12:03:24 PM UTC
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 6.2.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Thu 12 Aug 2021 12:44:42 AM UTC, comment #2: 

just out of curiosity it seems the balance point for these (in matlab 2021a) is between:


>> datevec(730972.12499999947613105177879333496093749)
ans =
   1.0e+03 *
  Columns 1 through 4
   2.001000000000000   0.005000000000000   0.001000000000000   0.002000000000000
  Columns 5 through 6
   0.059000000000000   0.059999900000001
>> datevec(730972.124999999477)
ans =
        2001           5           1           3           0           0

>> datevec(730972.12499999947613105177879333496093750)
ans =
        2001           5           1           3           0           0


no further bisecting makes it flip.

Nicholas Jankowski <nrjank>
Group Member
Thu 20 May 2021 03:21:34 PM UTC, comment #1: 

This is very similar to bug #59979.
Matlab seems to (arbitrarily?) impose a limit to the precision of input to date functions.

I'm still undecided if that is a good thing or not.

The output for me with Octave 6.2.0 on Windows:

>> datevec(730972.1249999999)
ans =

   2.0010e+03   5.0000e+00   1.0000e+00   2.0000e+00   5.9000e+01   6.0000e+01

>> ans(end)-60
ans = -1.5259e-05


The given time corresponds to approximately 15 µs before 3 am on 2001-May-01. So, technically that isn't at 3 am yet...

Markus Mützel <mmuetzel>
Group Member
Thu 20 May 2021 12:03:24 PM UTC, original submission:  

For the command in the subject, octave produces

octave> datevec(730972.1249999999)
ans =

 2001 5 1 2 59 60


whereas Matlab gives

>> datevec(730972.1249999999)


ans =

        2001           5           1           3           0           0

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.

     

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-20 mmuetzel CategoryNone Interpreter
        Item GroupNone Matlab Compatibility
        StatusNone Confirmed
        Operating SystemGNU/Linux Any

    Back to the top

    Powered by Savane 3.11