Constant folding is performing operations on constants at compile time:
x = angle * 3.1415926 / 180.0 y = sqrt(2.0) z = a
The savings from doing this on programmer expressions is minor. However, there can be major savings by optimizing:
Constant folding should not allow the programmer to ``break'' the compiler by writing a bad expression: sqrt(-1.0).