MCPcopy Create free account
hub / github.com/GJDuck/e9patch / atoi_digit

Function atoi_digit

examples/stdlib.c:2806–2820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2804/****************************************************************************/
2805
2806static int atoi_digit(char c, int base)
2807{
2808 int d = -1;
2809 if (c >= '0' && c <= '9')
2810 d = c - '0';
2811 else if (c >= 'a' && c <= 'z')
2812 d = 10 + (c - 'a');
2813 else if (c >= 'A' && c <= 'Z')
2814 d = 10 + (c - 'A');
2815 if (d < 0)
2816 return d;
2817 if (d >= base)
2818 return -1;
2819 return d;
2820}
2821
2822static __int128 atoi_convert(const char * __restrict__ nptr,
2823 char ** __restrict__ endptr, int base, __int128 min, __int128 max)

Callers 1

atoi_convertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected