Even the first c compiler did compile time constant calculations. Heck, I even included it when I wrote an image-processing expression parser based on the C parser using lex and yacc. So, the compiler will substitute the text into the expression and then calculate any constant expressions available at compile-time. Heck, it might even throw in the constant 2 that is also probably in the expression.
econjack:
I don't even know why the two constants aren't factored in the first place. That is, why not:
#define RAD2DEG 57.295779513 // 180.0 / PI
And what is the advantage of that? You have simply done the calculation the compiler would otherwise have done for you. The generated code will be EXACTLY the same in either case.
The 180/pi is also clearer to the maintainer. I kind of agree with Kernigham and Plauger in "The Elements of Programming Style": "We refuse to count characters" This was discussing why they used quoted FORTRAN strings instead of Hollerith Strings, but the sentiment is the same. That is also why C will count the initializers in an array and set the size for you, computers are much better at counting than you are.
KeithRB:
I kind of agree with Kernigham and Plauger in "The Elements of Programming Style": "We refuse to count characters" This was discussing why they used quoted FORTRAN strings instead of Hollerith Strings, but the sentiment is the same.
Hollerith strings have the huge advantage that you need not worry about control characters. (Think SQL injection and the like.) Unfortunately, though, there is also the huge disadvantage that humans can't be arsed to count. (Oh, I'm sure that we would learn to count, and count very well, if we were forced to; however, no one is forcing us to.)