S
Sheila Jones
Hello,
Can anybody tell me if the C# compiler will automatically inline simple
functions? To be specific, given:
double RadiansToDegrees(double degrees) {
return degrees*180.0/Math.PI;
}
will something like
y = RadiansToDegrees(x);
be compiled as
y = x*180.0/Math.PI;
rather than a function call?
Also, am I correct to assume that 180.0/Math.PI will be evaluated at compile
time rather than run time?
Thanks.
Can anybody tell me if the C# compiler will automatically inline simple
functions? To be specific, given:
double RadiansToDegrees(double degrees) {
return degrees*180.0/Math.PI;
}
will something like
y = RadiansToDegrees(x);
be compiled as
y = x*180.0/Math.PI;
rather than a function call?
Also, am I correct to assume that 180.0/Math.PI will be evaluated at compile
time rather than run time?
Thanks.