Merge pull request #1969 from Kurausukun/macros
Safeguard SQUARE and CUBE Macro Arguments in Parentheses
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#define SQUARE(n)(n * n)
|
||||
#define CUBE(n)(n * n * n)
|
||||
#define SQUARE(n)((n) * (n))
|
||||
#define CUBE(n)((n) * (n) * (n))
|
||||
|
||||
#define EXP_SLOW(n)((5 * CUBE(n)) / 4) // (5 * (n)^3) / 4
|
||||
#define EXP_FAST(n)((4 * CUBE(n)) / 5) // (4 * (n)^3) / 5
|
||||
|
||||
Reference in New Issue
Block a user