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

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

[Octave-bug-tracker] [bug #34713] str2double() ignores spaces and multip


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #34713] str2double() ignores spaces and multiple commas
Date: Wed, 21 Dec 2011 08:34:11 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6

Follow-up Comment #3, bug #34713 (project octave):

Thanks for looking into this.

FYI, ML r2007a does this:

>> str2double ('1,2,3,4')
ans =
        1234

>> str2double ('1 2 3 4')
ans =
   NaN

>> str2double ('1,234')
ans =
        1234

The first looks like a subtle ML bug to me - while commas are to be
interpreted as thousands separators, they turn out to concatenate groups of
any number of digits in ML r2007a.
(I'd expect only constructs with 3-digit groups to the right of the leftmost
comma would be accepted, like this:

>> str2double ('1,200,300,400')
ans =
  1.2003e+009
)


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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