Unexpected number of decimal places and Syntactical Query
<p>I'm trying to find the intersection between the curves $ y= x^2+3x+2 $ and $ y=x^2+2x+1$. For this, I have written the following python program:</p>

<pre><code>from numpy import *
import numpy as np
for x in np.arange(-100, 100, 0.0001):
    y_1=x**2+3*x+2
    y_2=x**2+2*x+1
    if round(y_1, 5)==round(y_2,5):
        print x
print 'end'
</code></pre>

<p>The console displays:</p>

<pre><code>-0.999999996714
end
</code></pre>

<p>I have three questions. </p>

<p>1) Why must I include <code>y_1=x**2+3*x+2</code> and <code>y_2=x**2+2*x+1</code> in the for statement? Why can I not simply include them after the line <code>from numpy import*</code>?</p>

<p>2) Why is the output to 12 decimal places when I have specified the step in <code>np.arange</code> to be 4 decimal places?</p>

<p>3) Why is -1.0000 not outputted?</p>

<p>Please go easy on me, I'm just starting to use python and thought I would try and solve some simultaneous equations with it.</p>

<p>Thanks,</p>

<p>Jack</p>