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

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

[Octave-bug-tracker] [bug #41286] datestr() returns wrong results if one


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #41286] datestr() returns wrong results if one of input params is int32
Date: Mon, 20 Jan 2014 19:50:29 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20100101 Firefox/17.0

Update of bug #41286 (project octave):

              Item Group:        Incorrect Result => Matlab Compatibility   
                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 
        Operating System:       Microsoft Windows => Any                    

    _______________________________________________________

Follow-up Comment #1:

Thanks for your report. However, I'm marking this as invalid because the date
functions have been intentionally modified to only accept double arguments. In
particular, your example in Octave 3.8.0 now shows:


octave:1> dat = datenum (int32 (2014), 1, 20);
error: datenum: all inputs must be of class double
error: called from:
error:   /usr/share/octave/3.8.0/m/time/datenum.m at line 114, column 5
octave:2> dat = datenum (2014, 1, 20);
octave:3> datestr (int32 (dat));
error: datenum: all inputs must be of class double
error: called from:
error:   /usr/share/octave/3.8.0/m/time/datenum.m at line 114, column 5
error: evaluating argument list element number 1
error:   /usr/share/octave/3.8.0/m/time/datestr.m at line 235, column 10


So that pushes the issue back on the caller to make sure the arguments are of
the correct type. This was fixed for Matlab compatibility, see bug #36587.

If you can show that this is not Matlab compatible behavior, please follow up
to this report and I'll reopen, but it looks like Octave 3.8.0 is now doing
the right thing in this case.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41286>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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