Why some books state that Primes is a NP problem if, as a decidibility problem, it can be solved in polynomial time?
A simple example:
A number can has its primality tested by dividing it by all numbers from 2 to \sqrt(n). It then takes at most \sqrt(n) operations to find if its prime.
After talking to colleagues, some stated that \sqrt() method is (was) in NP, but after reading about it it seems to take constant time for a certain precision (precision does not matter for this kind of problem).
Why then?
P.S.: Just to state, I know that P is within NP. The thing is not about it being contained, but it beign in NP and not in P (no polynomial solution).