octave-maintainers
[Top][All Lists]
Advanced

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

Re: str2double behavior


From: Rik
Subject: Re: str2double behavior
Date: Mon, 06 Jun 2011 14:46:26 -0700

One last question before I post a changeset for comments.

Does Matlab return a complex NaN or real NaN for unparseable inputs?

str2double ({ "abc"; "4i" })

returns

   NaN +   0i
     0 +   4i

with the current 3.4.0 implementation.  It seems like it should be NaN +
NaNi instead.  If Matlab returns NaN + NaNi, then are they being extra
clever and narrowing results to real if the only complex values are NaN?

Test case is

str2double ({ "abc"; "4" })


Thanks,
Rik


reply via email to

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