<li><strong><codeclass="python hljs"><spanclass="hljs-string">'int(<str>)'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'float(<str>)'</span></code> raise ValueError on malformed strings.</strong></li>
<li><strong>Decimal numbers can be represented exactly, unlike floats where <codeclass="python hljs"><spanclass="hljs-string">'1.1 + 2.2 == 3.3000000000000003'</span></code>.</strong></li>
<li><strong>Their precision can be adjusted with <codeclass="python hljs"><spanclass="hljs-string">'decimal.getcontext().prec = <int>'</span></code>.</strong></li>
<div><h3id="math">Math</h3><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> math <spanclass="hljs-keyword">import</span> e, pi, inf, nan
xxxxxxxxxx