LEN expands to (2 * 2 + 1) * (2 * 2 + 1), so your expression expands to
50 / (2 * 2 + 1) * (2 * 2 + 1)
In C++, division and multiplication have the same precedence, and associate left to right - effectively giving the same order of operations as in ordinary paper-and-pencil arithmetic. So the division gets evaluated before the outer multiplication. You are computing
(50 / (2 * 2 + 1)) * (2 * 2 + 1)
which is indeed 50.
Just because some tokens came from expanding a macro, does not automatically make them grouped into a single expression. When you want this, you have to include parentheses in the definition. So change your macro definition to
#define LEN ((2 * BLUR + 1) * (2 * BLUR + 1))
However, in modern C++ it is better to use a constexpr variable, and in that case the issue doesn't arise.
constexpr int BLUR = 2;
constexpr int LEN = (2 * BLUR + 1) * (2 * BLUR + 1);
will work as expected.
constorconstexprvariables instead.LENisn't 25; it's(2 * BLUR + 1) * (2 * BLUR + 1).#define 25. What you have is more of a "#define expression".