title: Convert.ToDecimal(double x) - System.OverflowException
body: <p>What is the maximum double value that can be represented\converted to a decimal?</p>
  
  <p>How can this value be derived - example please.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Given a maximum value for a double that can be converted to a decimal, I would expect to be able to round-trip the double to a decimal, and then back again. However, given a figure such as (2^52)-1 as in @Jirka's answer, this does not work. For example:</p>
  
  <pre><code>    Test]
      public void round_trip_double_to_decimal()
      {
          double maxDecimalAsDouble = (Math.Pow(2, 52) - 1);
  
          decimal toDecimal = Convert.ToDecimal(maxDecimalAsDouble);
  
          double toDouble = Convert.ToDouble(toDecimal);
  
          //Fails.
          Assert.That(toDouble, Is.EqualTo(maxDecimalAsDouble));
      }
  </code></pre>