This is a set of common functions for string and number processing. 更多...
#include <math.h>
#include <string.h>
#include <stdio.h>
函数 | |
int | format_string (char *str) |
This function examine whether a string represents a real number. 更多... | |
double | str2num (char *number) |
This function transform a string consisting '1', '2', ..., and '.' into the real number that it represents. 更多... | |
This is a set of common functions for string and number processing.
在文件 str_num_common.c 中定义.
int format_string | ( | char * | str | ) |
This function examine whether a string represents a real number.
Transform the string represents a negtive number into a string represents a positive one and return its' sign. It returns 0 if the string do not represents a real number. After calling this function, there will be only one 'e' in the string, and the only position for '-' is behind 'e', and there can be only one dot in the string and the only position for it in before 'e'.
[in] | str | String to be examined. |
1 | Positive number. |
-1 | Negative number. |
0 | Not a number. |
在文件 str_num_common.c 第 28 行定义.
double str2num | ( | char * | number | ) |
This function transform a string consisting '1', '2', ..., and '.' into the real number that it represents.
[in] | number | String of the real number. |
在文件 str_num_common.c 第 126 行定义.