I am writing a little library with some prime number related methods. As I\'ve done the groundwork (aka working methods) and now I\'m looking for some optimization. Ofcours
I guess this is your problem:
for (int idx = 3; idx < flooredAndSquared; idx++)
This should be
for (int idx = 3; idx <= flooredAndSquared; idx++)
so you don't get square numbers as primes. Also, you can use "idx += 2" instead of "idx++" because you only have to test odd numbers (as you wrote in the comment directly above...).