All prime numbers are positive integers. Squaring an integer always results in another integer. Addition of integers always results in integers. I don't see why rounding is required at all.
Your code is using the sqrt() function, which is the inverse of the square operation, which can have non-integer return values for integer input.
Take out a piece of paper and write down what steps you need to take (in plain english, or whatever natural language you are most comfortable using) to accomplish this task.