MCPcopy Create free account
hub / github.com/FastLED/FastLED / isDigitInBase

Function isDigitInBase

src/fl/stl/cstdlib.cpp.hpp:55–69  ·  view source on GitHub ↗

Helper function to check if a character is a digit in the given base

Source from the content-addressed store, hash-verified

53
54// Helper function to check if a character is a digit in the given base
55static bool isDigitInBase(char c, int base) {
56 if (base <= 10) {
57 return c >= '0' && c < ('0' + base);
58 }
59 if (c >= '0' && c <= '9') {
60 return true;
61 }
62 if (c >= 'a' && c < ('a' + base - 10)) {
63 return true;
64 }
65 if (c >= 'A' && c < ('A' + base - 10)) {
66 return true;
67 }
68 return false;
69}
70
71// Helper function to convert character to digit value
72static int charToDigit(char c) {

Callers 2

strtolFunction · 0.85
strtoulFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected