I read the issue about bullseyes in google code jam. (The contest is over, so it's ok to talk about it)

Maria begins with tons of black ink, which she will use to draw rings 1 cm thick (one centimeter). A ring 1 cm thick is the space between two concentric circles whose radii differ by 1 cm.
Maria draws the first black ring around a white circle of radius r cm.
The area of ββa disk with a radius of 1 cm is Ο cm2. One milliliter of paint is required to cover an area of ββΟ cm2. What is the maximum number of black rings that Mary can draw?
According to my calculations on paper, the area of ββpaint to draw a bullseye with n rings, the inner radius r, as a multiple of pi, is 2*n**2 + n*(2*r-1)
So, given t*pi milliliter of paint, the task is to find the greatest n such that f(n,r) <= t .
This morning I decided that with binary search https://github.com/hickford/codejam/blob/master/2013/1A/bullseye/bullseye.py
I chose the binary search by the quadratic equation, because I am very careful about floating point inaccuracies - in this problem t and r are integers, such as 10 ** 18). An arithmetic inaccuracy bit me in a previous code jam.
But I'm curious. Can you strengthen the quadratic equation to give the correct answer for equations with large integer coefficients? Can math libraries like Sympy or Numpy offer me?
Demonstrating that a quadratic equation gives the wrong answer for large inputs. For example, with r=308436464205151562 and t=1850618785230909388 . The solution of the quadratic equation
2*n**2 + 616872928410303123*n -1850618785230909388 <= 0
t. odds
a = 2 b = 616872928410303123 c = -1850618785230909388
Python Computation
> int((-b + math.sqrt(b**2 - 4*a*c)) / (2*a)) 0
This is the wrong answer! The correct answer (found by binary search) is 3
>>> n = 3 >>> 2*n**2 + 616872928410303123*n -1850618785230909388 <= 0 True