Our maths teacher taught us that conditions for roots of a quadratic equation $ax^2+bx+c=0$ to lie at infinity are :
A) (for exactly one root at infinity) $a=0$, $b$ = non-zero, & $c$ can be zero or non-zero
B) (for both roots at infinity) $a = 0$, $b= 0$, and $c$ = non-zero
By equal to zero, I mean the coefficients are so small that they are nearly zero, i.e approaching zero. They can’t be exactly equal to zero right? Or it would no longer be a quadratic. Please correct me if I’m wrong.
This is not my question though. What I want to ask is, are these the only two conditions for roots of a quadratic equation to lie at infinity?
For example, if we consider the equations
1) $x^2-4\times 10^{30} = 0$
2) $0.00000001x^2+ 0.0000005x + 6 = 0$
I have attached two screenshots. In the first equation, both roots are at infinity even though coefficient of $x^2$ is non-zero (contrary to what condition (A) says.
In the second equation, none of the roots are lying at infinity even thought coefficients of $x^2$ and $x$ are nearly equal to zero, which again is not consistent with what condition (B) says.
How do I explain these discrepancies?
(Looks like I can’t attach more than one pic here. So I’m attaching just one, graph of equation (2). It’s clear that both roots of equation (1) are at infinity.)

Polynomials do not have "roots at infinity." I'm not totally sure about what you mean, but an equation like $f(x)=\frac{1}{x}$ might satisfy your condition. However, polynomials do not have a root at infinity because if such a polynomial $P(x)$ exists, then one factor of $P(x)$ would have to be $(x-\infty)$.