|
From: Robert H. <en...@no...> - 2005-06-09 11:14:38
|
On Thu, 2005-06-09 at 15:26 +0800, Hans-Bernhard Br=F6ker wrote: > That's exactly the error checking I'm talking about. Without it,=20 > handling missing or malformed data would be impossible. > > There's not a lot you could do with strtod() that sscanf() couldn't do=20 > just as well. strtod() is indeed significantly faster than sscanf.=20 I am testing using the following: #ifdef USE_STRTOD char *fin; df_column[df_no_cols].datum=3Dstrtod(s,&fin); used=3Ds-fin; count=3Dused?1:0; #else count =3D sscanf(s, "%lf%n", &df_column[df_no_cols].datum, &used); #endif Can anybody come up with any cases where these two methods give different results/error handling? strtod is ANSI C, so should be portable. I've attached a "non-intrusive" patch, however if this approach is acceptable, I think the OSK path should be removed, and the NO_FORTRAN_NUMS code should be removed or simplified. Are there any cases when somebody wouldn't want a fortran float interpreting properly? Rob =20 --=20 Robert Hart <en...@no...> University of Nottingham This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. |