ss1snd - Scan a double from a string in scientific notation
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
const char *input_str,
This routine reads a double from a string in scientific notation with more
sophisticated error reporting that available using scanf. If the contents of
"str" is exactly one number which is appropriate for a double, then it sets
*double_ptr to that number and returns NO_ERROR. Otherwise and error message
is set, and ERROR is returned. The contents of *double_ptr are only changed
If str is either "off" or "none", then the special value DBL_NOT_SET is
returned. Otherwise, str must contain a single valid number, possibly
followed by a "%". If str ends with a "%", then the number is assumed to be
a percentage, and the result is divided by 100.0.
If "str" represents a valid double, then NO_ERROR is returned. Otherwise
the problem with "str" is reported in the set error message, and ERRROR is
returned. The problem with "str" can be printed with kjb_print_error.
For successful return, "str" cannot contain two numbers. For example, it
can't be something like "1 2".
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.