MCPcopy Create free account
hub / github.com/ablab/spades / getDigit

Function getDigit

ext/src/llvm/APInt.cpp:50–74  ·  view source on GitHub ↗

A utility function that converts a character to a digit.

Source from the content-addressed store, hash-verified

48
49/// A utility function that converts a character to a digit.
50inline static unsigned getDigit(char cdigit, uint8_t radix) {
51 unsigned r;
52
53 if (radix == 16 || radix == 36) {
54 r = cdigit - '0';
55 if (r <= 9)
56 return r;
57
58 r = cdigit - 'A';
59 if (r <= radix - 11U)
60 return r + 10;
61
62 r = cdigit - 'a';
63 if (r <= radix - 11U)
64 return r + 10;
65
66 radix = 10;
67 }
68
69 r = cdigit - '0';
70 if (r < radix)
71 return r;
72
73 return -1U;
74}
75
76
77void APInt::initSlowCase(uint64_t val, bool isSigned) {

Callers 1

fromStringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected