title: C++ avoid type conversion warning with typedef
body: <p>I am using <code>typedef float engtype</code> and <code>typedef double engtype</code> to quickly change between <code>float</code> and <code>double</code> for some testing.  When I did this for example</p>
  
  <pre><code>engtype rmwt = 20.75;
  engtype Rgas = 8314.28 / rmwt;
  </code></pre>
  
  <p>The compiler complains of possible data loss or truncation to convert from <code>double</code> to <code>engtype</code>.  In order to make that warning go away I did this</p>
  
  <pre><code>engtype rmwt = 20.75;
  engtype Rgas = static_cast&lt;engtype&gt;(8314.28) / rmwt;
  </code></pre>
  
  <p>This seems a little ridiculous.  I googled for a way to make it default to <code>engtype</code> but didn't find anything.  Is this usage of <code>typedef</code> incorrect?  How should I deal with the warnings?  I understand I can just ignore them but there should be a "correct" way to clear them.</p>