title: Python3 Infinity/NaN: Decimal vs. float
body: <h3>Given (Python3):</h3>
  <pre><code>&gt;&gt;&gt; float('inf') == Decimal('inf')
  True 
  
  &gt;&gt;&gt; float('-inf') &lt;= float('nan') &lt;= float('inf')
  False
  
  &gt;&gt;&gt; float('-inf') &lt;= Decimal(1) &lt;= float('inf')
  True
  </code></pre>
  <p>Why are the following invalid? I have read <a href="https://docs.python.org/3.4/library/decimal.html#special-values" rel="nofollow noreferrer">Special values</a>.</p>
  <h3>Invalid</h3>
  <pre><code>&gt;&gt;&gt; Decimal('-inf') &lt;= Decimal('nan') &lt;= Decimal('inf')
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  decimal.InvalidOperation: [&lt;class 'decimal.InvalidOperation'&gt;]
  
  &gt;&gt;&gt; Decimal('-inf') &lt;= float('nan') &lt;= Decimal('inf')
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  decimal.InvalidOperation: [&lt;class 'decimal.InvalidOperation'&gt;]
  
  &gt;&gt;&gt; float('-inf') &lt;= Decimal('nan') &lt;= float('inf')
  Traceback (most recent call last):
    File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;
  decimal.InvalidOperation: [&lt;class 'decimal.InvalidOperation'&gt;]
  </code></pre>