High Precision Constants for Templated Code
<p>I am writing a template class which takes a floating-point-like type (float, double, decimal, GMP) as a parameter. However, my class requires various numeric constants. Some of these are rational numbers (int/int) while others are irrational and available to 30 or so decimal places.</p>

<p>What is the best way to go about initialising these constants, so:</p>

<pre><code>T c1 = &lt;constant&gt;;
</code></pre>

<p>where T is the templated type?</p>

<p>While I could always fall-back on doubles (T c1 = 0.1415926535...) and rely on the compiler/implicit initialiser to convert to the appropriate type I would like to retain the extra precision if at all possible.</p>

<p>I am interested in both current solutions and those which C++0x (or is it C++1x?) might bring to the table.</p>
