Go to the source code of this file.
Data Structures | |
| struct | div_t |
| struct | ldiv_t |
Defines | |
| #define | _SIZE_T |
| #define | _SIZE_T_ |
| #define | _WCHAR_T |
| #define | _WCHAR_T_ |
| #define | EXIT_FAILURE 1 |
| #define | EXIT_SUCCESS 0 |
| #define | MB_CUR_MAX 1 |
| #define | NULL 0 |
| #define | RAND_MAX 32767 |
Typedefs | |
| typedef unsigned long | size_t |
| typedef unsigned char | wchar_t |
Functions | |
| void | abort (void) |
| int | abs (int) |
| int | atexit (void(*)(void)) |
| double | atof (const char *) |
| int | atoi (const char *) |
| long int | atol (const char *) |
| void * | bsearch (const void *, const void *, size_t, size_t, int(*)(const void *, const void *)) |
| void * | calloc (size_t, size_t) |
| div_t | div (int, int) |
| void | exit (int) |
| void | free (void *) |
| char * | getenv (const char *) |
| long int | labs (long int) |
| ldiv_t | ldiv (long int, long int) |
| void * | malloc (size_t) |
| int | mblen (const char *, size_t) |
| size_t | mbstowcs (wchar_t *, const char *, size_t) |
| int | mbtowc (wchar_t *, const char *, size_t) |
| void | qsort (void *, size_t, size_t, int(*)(const void *, const void *)) |
| int | rand (void) |
| void * | realloc (void *, size_t) |
| void | srand (unsigned int) |
| double | strtod (const char *, char **) |
| long int | strtol (const char *, char **, int) |
| unsigned long int | strtoul (const char *, char **, int) |
| int | system (const char *) |
| size_t | wcstombs (char *, const wchar_t *, size_t) |
| int | wctomb (char *, wchar_t) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 781 of file bg_lib.c. 00781 {
00782 float sign;
00783 float value;
00784 int c;
00785
00786
00787 // skip whitespace
00788 while ( *string <= ' ' ) {
00789 if ( !*string ) {
00790 return 0;
00791 }
00792 string++;
00793 }
00794
00795 // check sign
00796 switch ( *string ) {
00797 case '+':
00798 string++;
00799 sign = 1;
00800 break;
00801 case '-':
00802 string++;
00803 sign = -1;
00804 break;
00805 default:
00806 sign = 1;
00807 break;
00808 }
00809
00810 // read digits
00811 value = 0;
00812 c = string[0];
00813 if ( c != '.' ) {
00814 do {
00815 c = *string++;
00816 if ( c < '0' || c > '9' ) {
00817 break;
00818 }
00819 c -= '0';
00820 value = value * 10 + c;
00821 } while ( 1 );
00822 } else {
00823 string++;
00824 }
00825
00826 // check for decimal point
00827 if ( c == '.' ) {
00828 double fraction;
00829
00830 fraction = 0.1;
00831 do {
00832 c = *string++;
00833 if ( c < '0' || c > '9' ) {
00834 break;
00835 }
00836 c -= '0';
00837 value += c * fraction;
00838 fraction *= 0.1;
00839 } while ( 1 );
00840
00841 }
00842
00843 // not handling 10e10 notation...
00844
00845 return value * sign;
00846 }
|
|
|
|
|
|
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
|
|
|
Definition at line 776 of file bg_lib.c.
|
|
||||||||||||
|
|
|
|
Definition at line 772 of file bg_lib.c. 00772 {
00773 randSeed = seed;
00774 }
|
|
||||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
1.3.9.1