I\'m looking for the fastest way to determine if a long
value is a perfect square (i.e. its square root is another integer):
For performance, you very often have to do some compromsies. Others have expressed various methods, however, you noted Carmack's hack was faster up to certain values of N. Then, you should check the "n" and if it is less than that number N, use Carmack's hack, else use some other method described in the answers here.