pyspeedup/algorithms/_squares.py
def isSquare(n):
    '''
    Checks for perfect squares by checking mod 64 to rule out 52/64 cases immediately.

    It does so by checking various smaller mods, such as mod 4, where 2 and 3 aren't possible.
    '''
    # non-neg and mod 4  and mod 8    and mod 16    and mod 32     and mod 64         #mod isSquare.mod
    m=math.floor(math.sqrt(n)+.5)
    return m*m==n and m
    if n>=0 and (n&2==0) and (n&7!=5) and (n&11!=8):# and (n&31!=20):# and (32!=x&63!=48):#(n%isSquare.mod in isSquare.set):
        m=math.floor(math.sqrt(n)+.5)
        return m*m==n and m
    return False

    Checks for perfect squares by checking mod 64 to rule out 52/64 cases immediately.

    It does so by checking various smaller mods, such as mod 4, where 2 and 3 aren't possible.
    
Checks for perfect squares by checking mod 64 to rule out 52/64 cases immediately.
It does so by checking various smaller mods, such as mod 4, where 2 and 3 aren't possible.
Checks for perfect squares by checking mod 64 to rule out 52 / 64 cases immediately . It does so by checking various smaller mods such as mod 4 where 2 and 3 aren ' t possible .
def isSquare(n):
    m=math.floor(math.sqrt(n)+.5)
    return m*m==n and m
    if n>=0 and (n&2==0) and (n&7!=5) and (n&11!=8):
        m=math.floor(math.sqrt(n)+.5)
        return m*m==n and m
    return False
def isSquare ( n ) : m = math . floor ( math . sqrt ( n ) + .5 ) return m * m == n and m if n >= 0 and ( n & 2 == 0 ) and ( n & 7 != 5 ) and ( n & 11 != 8 ) : m = math . floor ( math . sqrt ( n ) + .5 ) return m * m == n and m return False
Checks for perfect squares by checking mod 64 to rule out 52/64 cases immediately.
Checks for perfect squares by checking mod 64 to rule out 52 / 64 cases immediately .
'''
    Checks for perfect squares by checking mod 64 to rule out 52/64 cases immediately.

    It does so by checking various smaller mods, such as mod 4, where 2 and 3 aren't possible.
    ''' # non-neg and mod 4  and mod 8    and mod 16    and mod 32     and mod 64         #mod isSquare.mod # and (n&31!=20):# and (32!=x&63!=48):#(n%isSquare.mod in isSquare.set):
n