2 ms·
You already can't, because someone can write the constant in hex, or even (shudder) octal.
by AnimalMuppet 4y ago
You already can't, because someone can write the constant in hex, or even (shudder) octal.
- adrianmonk 4y agoOr like this: const int WAIT_TIME_MICROSECONDS = 42 * 1000 * 1000; // 42 seconds
- tmtvl 4y agoOr: 0x2A * 10e6; The solution is clearly to have language tooling with a find-constant tool which you give an expression and it parses all declarations in the source code looking for one which evaluates at compile time to the provided expression.