Technically, much storage does not need voltage being high or low either. Pits burned with lasers, and magnetic changes are also common ways to store stuff that don&#x27;t involve voltage in the stored state.<p>Here you can see python has a <i>fractions.Fraction</i> type which can be used for rational number arithmetic.<p><pre><code>  &gt;&gt;&gt; from fractions import Fraction
  &gt;&gt;&gt; Fraction(&quot;0.1&quot;) + Fraction(&quot;0.2&quot;)
  Fraction(3, 10)

  &gt;&gt;&gt; repr(float(Fraction(&quot;0.1&quot;) + Fraction(&quot;0.2&quot;)))
  &#x27;0.3&#x27;
</code></pre>
Here we see the floating point behaviour.<p><pre><code>  &gt;&gt;&gt; 0.1 + 0.2
  0.30000000000000004
</code></pre>
Here we see that python has a nice behaviour for when printing floats.<p><pre><code>  &gt;&gt;&gt; print(0.1 + 0.2)
  0.3
 
</code></pre>
Here is a common error where people feed the input of Fraction (and Decimal) with a float. Even though you use the Fraction here it still carries the floating point error through.<p><pre><code>  &gt;&gt;&gt; Fraction(0.1) + Fraction(0.2)
  Fraction(10808639105689191, 36028797018963968)
  &gt;&gt;&gt; float(Fraction(0.1) + Fraction(0.2))
  0.30000000000000004

</code></pre>
Here is the Decimal type which does not have this float problem. Some people have argued (including myself) that Decimal should be used by python instead of float. Since this is much friendlier to people doing things like adding these numbers together.<p><pre><code>  &gt;&gt;&gt; from decimal import Decimal
  &gt;&gt;&gt; Decimal(&quot;0.1&quot;) + Decimal(&quot;0.2&quot;)
  Decimal(&#x27;0.3&#x27;)
  &gt;&gt;&gt; float(Decimal(&quot;0.1&quot;) + Decimal(&quot;0.2&quot;))
  0.3</code></pre>