We all know that so-called magic numbers are bad in a program. They are sometimes needed though and the usual technique is to create a human-readable #define so at least you know what the number represents, for example
if (x < 3600) do_something();
What the heck is 3600? But
#define SECONDS_PER_HOUR 3600
...
if (x < SECONDS_PER_HOUR) do_something();
Makes some sense. So I had call to revisit some old code for my digital speedo today and found this
#define PULSES_PER_K (2089 - 21)
#define PULSES_PER_100M (PULSES_PER_K / 10)
#define MAGIC_NUMBER (16604 * 1.12)
Lucky I had that last define or I'd never know that the heck (16604 * 1.12) represents.
______
Rob