28 #include <Exception/Exception.h> 47 if ( NULL == txt ||
'\0' == *txt )
48 throw Exception(
"suplib::str2d( ) : Empty field" );
52 double result = strtod( txt, &ptr );
54 if ( ERANGE == errno )
55 throw Exception(
"suplib::str2d( " +
string( txt ) +
56 ") : Variable overflow" );
59 throw Exception(
"suplib::str2d( " +
string( txt ) +
60 " ) Not a number, problem at `" +
string( ptr ) +
"'" );
double str2d(const char *txt)
convert string to double-precision number