python- Evaluating large floating point number against its rounded equivilent
<p>I have a a file like this,</p>

<p>...</p>

<p>3.999999000000e-003   1.2344325e-003</p>

<p>4.000000000000e-003   1.2342323e-003</p>

<p>...</p>

<p>I am trying to find find only values equal to 0.004 (4.000000000000e-003 long form) but I dont want to have to input the long form as the precisions can change from file to file. I have to do a line split beforehand, so I also have to convert it from a string first.</p>

<p>How can I evaluate something like 0.004 == 4.000000000000e-003 in python?</p>

<p>I currently have been trying stuff like, but obviously its not working</p>

<pre><code>        line_tmp = line.split()

        if float(line_tmp[0]) == 0.004:
            print(line_tmp[0])
            print(float(line_tmp[0]))
</code></pre>
