C#, DETERMINE *if* a double can become an int without any loss
<p>I have a unique situation in which all numbers must be saved as <code>double</code> data type in my database, but only in certain conditions is the precision beyond the integer level valuable. </p>

<p>At first, I tried to just use <code>int</code> and then abstract to a new table when these unique fractional occurances would happen, but after doing that for weeks I can see now that it is excessively stupid and wasting my time. </p>

<p>I know that I can turn a <code>double</code> into an <code>int</code>. That is easy. I know how to translate it over. What I do not know is how to TEST for translating it over. I basically wish to come up with a short, easy way to say</p>

<blockquote>
  <p>Is this number really a double, or is it just an int?</p>
</blockquote>

<p>If it is an int (and most of the time, it will be), then I will turn it into one and treat it as such. But due to the uniqueness of the requirements, I have to still save everything in the database as <code>double</code>.</p>

<p>Any ideas? I know this is a newbie question, and I've googled around for several hours and am still left quite confused.</p>
