43 long long int strtoll(
const char* nptr,
char** endptr,
int base)
47 long long int acc, cutoff;
54 if(base < 0 || base > 36)
60 *endptr = (
char*)(uintptr_t)nptr;
80 c = (
unsigned char)*s++;
97 if((base == 0 || base == 16) && c ==
'0' && (*s ==
'x' || *s ==
'X'))
106 base = c ==
'0' ? 8 : 10;
129 cutlim = (int)(cutoff % base);
140 for(acc = 0, any = 0;; c = (
unsigned char)*s++)
151 c -=
isupper(c) ?
'A' - 10 :
'a' - 10;
174 if(acc < cutoff || (acc == cutoff && c > cutlim))
189 if(acc > cutoff || (acc == cutoff && c > cutlim))
206 *endptr = (
char*)(uintptr_t)(any ? s - 1 : nptr);
int isupper(int ch)
Checks if the given character is an uppercase character.
int isalpha(int ch)
Checks if the given character is an alphabetic character.
long long int strtoll(const char *nptr, char **endptr, int base)
int isspace(int ch)
Checks if the given character is a whitespace character.
int isdigit(int ch)
Checks if the given character is a numeric character.