Is there any advantage in declaring a variable local to a function const? i.e., I want to use a sine value a couple of times so I store it in a local variable. If I make it const does this facilitate any compiler optimizations... or anything beneficial?
double my_func(double pitch, ...)
{
const double sP = sin(pitch * 0.5);
...
}