12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #ifndef TODIGIT_SOURCE
- #define TODIGIT_SOURCE
- #include <limits.h>
- #include "../tools/number.h"
- unsigned todigit (unsigned c)
- {
- if ((c >= '0') && (c <= '9'))
- {
- return (c - '0');
- }
- if ((c >= 'A') && (c <= 'Z'))
- {
- return (c - 'A' + 10);
- }
- if ((c >= 'a') && (c <= 'z'))
- {
- return (c - 'a' + 10);
- }
- return (UCHAR_MAX);
- }
- #endif
|