Mercurial > hg > octave-lyh
comparison liboctave/lo-utils.cc @ 6907:c8081f4c094f
[project @ 2007-09-17 17:31:10 by jwe]
author | jwe |
---|---|
date | Mon, 17 Sep 2007 17:31:10 +0000 |
parents | 935d23e16951 |
children | 93c65f2a5668 |
comparison
equal
deleted
inserted
replaced
6906:c5118619023e | 6907:c8081f4c094f |
---|---|
24 | 24 |
25 #ifdef HAVE_CONFIG_H | 25 #ifdef HAVE_CONFIG_H |
26 #include <config.h> | 26 #include <config.h> |
27 #endif | 27 #endif |
28 | 28 |
29 #include <cctype> | |
29 #include <cstdlib> | 30 #include <cstdlib> |
30 #include <cstdio> | 31 #include <cstdio> |
31 | 32 |
32 #include <limits> | 33 #include <limits> |
33 #include <string> | 34 #include <string> |
260 double | 261 double |
261 octave_read_double (std::istream& is) | 262 octave_read_double (std::istream& is) |
262 { | 263 { |
263 double d = 0.0; | 264 double d = 0.0; |
264 | 265 |
265 char c1 = 0; | 266 char c1 = ' '; |
266 | 267 |
267 c1 = is.get (); | 268 while (isspace (c1)) |
269 c1 = is.get (); | |
270 | |
268 switch (c1) | 271 switch (c1) |
269 { | 272 { |
270 case '-': | 273 case '-': |
271 { | 274 { |
272 char c2 = 0; | 275 char c2 = 0; |
315 { | 318 { |
316 double re = 0.0, im = 0.0; | 319 double re = 0.0, im = 0.0; |
317 | 320 |
318 Complex cx = 0.0; | 321 Complex cx = 0.0; |
319 | 322 |
320 char ch = 0; | 323 char ch = ' '; |
321 | 324 |
322 ch = is.get (); | 325 while (isspace (ch)) |
326 ch = is.get (); | |
323 | 327 |
324 if (ch == '(') | 328 if (ch == '(') |
325 { | 329 { |
326 re = octave_read_double (is); | 330 re = octave_read_double (is); |
327 ch = is.get (); | 331 ch = is.get (); |