Relative Content

Tag Archive for c++divisionpreprocessor

why division doesn’t work with #define numbers?

#define BLUR 2 #define LEN (2 * BLUR + 1) * (2 * BLUR + 1) using namespace std; int main() { cout << 50 / LEN; // result is 50 } the expected result is 2 but it’s 50. I try another numbers but get the wrong answer. with other operation like *, + […]

why division don’t work with #define numbers?

#define BLUR 2 #define LEN (2 * BLUR + 1) * (2 * BLUR + 1) using namespace std; int main() { cout << 50 / LEN; // result is 50 } the expected result is 2 but it’s 50. I try another numbers but get the wrong answer. with other operation like *, + […]

why divion don’t work with #define numbers?

#define BLUR 2 #define LEN (2 * BLUR + 1) * (2 * BLUR + 1) using namespace std; int main() { cout << 50 / LEN; // result is 50 } the expected result is 2 but it’s 50. I try another numbers but get the wrong answer. with other operation like *, + […]