Int or Unsigned Int to float without getting a warning
<p>Sometimes I have to convert from an unsigned integer value to a float. For example, my graphics engine takes in a <code>SetScale(float x, float y, float z)</code> with floats and I have an object that has a certain size as an <code>unsigned int</code>. I want to convert the unsigned int to a float to properly scale an entity (the example is very specific but I hope you get the point). </p>

<p>Now, what I usually do is: </p>

<pre><code>unsigned int size = 5;
float scale = float(size);
My3DObject-&gt;SetScale(scale , scale , scale);
</code></pre>

<p>Is this good practice at all, under certain assumptions (see Notes)? Is there a better way than to litter the code with <code>float()</code>?</p>

<blockquote>
  <p><strong>Notes:</strong> I cannot touch the graphics API. I have to use the SetScale() function which takes in floats. Moreover, I also cannot touch the size, it has to be an unsigned int. I am sure there are plenty of other examples with the same 'problem'. The above can be applied to any conversion that needs to be done and you as a programmer have little choice in the matter.</p>
</blockquote>
