title: Precision of rounded decimals giving nans for linear equation solving
body: <p>Apologies for the butchered title, not sure what I should call this.</p>
  <p>I'm solving for the upper limit of integration of a linear equation, like in this question: <a href="https://math.stackexchange.com/questions/3878448/solving-for-limit-of-integration-of-a-linear-equation">https://math.stackexchange.com/questions/3878448/solving-for-limit-of-integration-of-a-linear-equation</a></p>
  <p>Except the question above asks for the lower limit, and below I solve for the upper limit as <code>xincrements</code>:</p>
  <pre><code>import numpy as np
  
  yvals = np.random.uniform(size=2)
  xvals = np.random.uniform(size=2)
  
  slope = np.diff(yvals) / np.diff(xvals)
  intercept = yvals[:-1] - (xvals[:-1] * slope)
  
  area = np.trapz(yvals, xvals)
  
  nsplits = 100000
  a = np.linspace(0, area, nsplits+1)
  m = slope
  b = intercept
  c = xvals[0]
  
  xincrements = ((-1*b) + np.sqrt((b**2) - (4*(0.5*m)*(-0.5*m*(c**2) - (b*c) - a)))) / m
  </code></pre>
  <p>This works perfectly when using random floats, and most values, as it should.</p>
  <p>However, problems arise when introducing truncated/rounded decimals into the mix. For example using these starting points</p>
  <pre><code>xvals = np.array([317.16760254, 317.16763306])
  yvals = np.array([1570203.5 ,       0.  ])
  </code></pre>
  <p>throws a <code>RunTimeWarning</code> because the value inside the square root function is negative. This occurs at any value of <code>nsplits</code> on the last value of <code>xincrements</code> if you start at a low <code>nsplits</code>, like 10, or 100. If you increase <code>nsplits</code> to 100000 or so, you can see this problem spreads out to more than just the last value.</p>
  <p>It's having issues solving for values that are very close to <code>xvals[1]</code> of my specific example. I seem to run into the same problem with other truncated decimals as well.</p>
  <p>Why is this, and is there anything I can do about this?</p>