...
Code Block | ||
---|---|---|
| ||
#define PI 3.1415914159f float degrees; float radians; /* ... */ radians = degrees * PI / 180; |
...
Compliant Solution
In this compliant solution, pi
is declared as a const
-qualified object, allowing the constant to have scope and to have its value inspected by a debugger.
Code Block | ||
---|---|---|
| ||
const float pi = 3.1415914159f; float degrees; float radians; /* ... */ radians = degrees * pi / 180; |
...