[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: str2double API changes
From: |
Carnë Draug |
Subject: |
Re: str2double API changes |
Date: |
Sun, 5 Jun 2011 12:22:41 +0100 |
On 5 June 2011 04:47, Ben Abbott <address@hidden> wrote:
> On Jun 4, 2011, at 6:42 PM, Rik wrote:
>> The new behavior (i.e., no extra return status) makes the function Matlab
>> compatible. The documentation for str2double from Mathworks is here:
>> http://www.mathworks.com/help/techdoc/ref/str2double.html.
>
> I don't think this is an issue of Matlab compatibility. Granted that
> supporting
> the return status means that Matlab isn't consistent with Octave, but Octave
> is still compatible with Matlab, correct?
Yup. I think this is correct.
I went to recheck the behavior of str2double on 3.2. The status
returned is -1 (failure) when conversion fails because the text is
gibberish (and is converted into NaN) and 0 (success) when conversion
of the string 'nan' is successfully converted to NaN. This means that
even if the new behavior of returning an error on non-string input
(which I don't know if is compatible with MatLab), the return status
can still be useful.
Carnë
Re: str2double API changes, Ben Abbott, 2011/06/04
- Re: str2double API changes,
Carnë Draug <=