...
In this compliant solution, pi is declared as a const-qualified object, allowing the constant to have scope.
| Code Block | ||
|---|---|---|
| ||
float const pi = 3.14159; float degrees; float radians; /* ... */ radians = degrees * pi / 180; |
This While inadequate in some ways, this is the best solution that can be done for non-integer constants.
...