title: Problems with Rounding Decimals (python)
body: <p>In my program, decimal accuracy is very important.<br>
  A lot of my calculations must be accurate to many decimal places (such as 50).  </p>
  
  <p>Because I am using python, I have been using the decimal module
   (with context().prec = 99. ie;  <em>Set to have 99 decimal places of accuracy when instantiating a decimal object</em>)<br>
  as pythonic floats don't allow anywhere near such accuracy.</p>
  
  <p>Since I wish for the User to specify the decimal places of accuracy of the calculations, I've had to implement several round() functions in my code.<br>
  Unfortuneately, the inbuilt round function and the decimal object do not interact well.</p>
  
  <pre><code>round(decimal.Decimal('2.000000000000000000001'),50)
  
  # Number is 1e-21.   There are 21 decimal places, much less than 50.
  </code></pre>
  
  <p>Yet the result is <strong>2.0</strong> instead of <strong>2.000000000000000000001</strong><br>
  The round function is not rounding to 50. Much less!</p>
  
  <p>Yes,  I have made sure that the over-rounding does not occur on instantiation of the Decimal object, but after calling round.<br>
  I always pass strings representing floats to the Decimal constructor, never pythonic floats.</p>
  
  <p>Why is the round function doing this to me?<br>
  (I realise that it was probably originally designed for pythonic floats which can never have so many decimal places, but the documentation claims that the Decimal object integrates perfectly into python code and is compatible with the inbuilt python functions!)</p>
  
  <p>Thanks profusely!<br>
  (This has me quite unnerved, since this problem undermines the use of the entire program)</p>
  
  <p>Specs:<br>
  python 2.7.1<br>
  Windows 7<br>
  decimal module (inbuilt)</p>