title: How to get largest possible precision? (Python - Decimal)
body: <p>I'm using the <a href="https://docs.python.org/2/library/decimal.html" rel="noreferrer">Decimal</a> class for operations that requires precision.</p>
  
  <p>I would like to use 'largest possible' precision. With this, I mean as precise as the system on which the program runs can handle.</p>
  
  <p>To set a certain precision it's simple:</p>
  
  <pre><code>import decimal
  decimal.getcontext().prec = 123 #123 decimal precision
  </code></pre>
  
  <p>I tried to figure out the maximum precision the 'Decimal' class can compute:</p>
  
  <pre><code>print(decimal.MAX_PREC)
  &gt;&gt; 999999999999999999
  </code></pre>
  
  <p>So I tried to set the precision to the maximum precision (knowing it probably won't work..):</p>
  
  <pre><code>decimal.getcontext().prec = decimal.MAX_PREC
  </code></pre>
  
  <p>But, of course, this throws a <strong>Memory Error</strong> (on division)</p>
  
  <p>So my question is: How do I figure out the maximum precision the current system can handle?</p>
  
  <p>Extra info:</p>
  
  <pre><code>import sys
  print(sys.maxsize)
  &gt;&gt; 9223372036854775807
  </code></pre>