floats inside tuples changing values when accessed
<p>So I have a list of tuples of two floats each.  Each tuple represents a range.  I am going through another list of floats which represent values to be fit into the ranges.  All of these floats are &lt; 1 but positive, so precision matter.  One of my tests to determine if a value fits into a range is failing when it should pass. If I print the value and the range that is causing problems I can tell this much:</p>

<pre><code>curValue = 0.00145000000671 
range = (0.0014500000067055225, 0.0020968749796738849)
</code></pre>

<p>The conditional that is failing is:</p>

<pre><code>if curValue &gt; range[0] and ... blah :
    # do some stuff
</code></pre>

<p>From the values given by curValue and range, the test should clearly pass (don't worry about what is in the conditional).  Now, if I print explicitly what the value of range[0] is I get:</p>

<pre><code> range[0] =  0.00145000000671
</code></pre>

<p>Which would explain why the test is failing.  So my question then, is why is the float changing when it is accessed.  It has decimal values available up to a certain precision when part of a tuple, and a different precision when accessed.  Why would this be?  What can I do to ensure my data maintains a consistent amount of precision across my calculations?</p>
