title: evaluate expression at compile time
body: <p>I know this has been asked a lot, but only for C/C++ and Java.
  The question is related to the performance benefits of using constant expressions:</p>
  
  <p>When I call a static function with only constants as arguments, is there a way to tell the compiler that it should evaluate the call already at compile time and replace the call by the result?</p>
  
  <p>Example:  </p>
  
  <pre><code>const double pi = Math.PI; //works as Math.PI is a constant  
  const double spi = Math.Sin(Math.PI); //compiler error, because expression must be constant  
  </code></pre>
  
  <p>Are there no directives (better: Attributes) to tell the compiler explicitely that a static method like Math.Sin() is not modifying nor reading any data internally, so that it was technically possible to evaluate the call at compile time?</p>
  
  <p>Oh, and please don't answer like "just do <code>const double spi = 0</code>" :), because my example is just a simplified version of the problem I have: Improving code maintainability while keeping maximum performance.</p>
  
  <p>Thanks for any help - it is really appreciated!</p>