```python
import math

def divisor(n):
    """
    Finds the number of divisors of a given integer.
    """
    if n == 0:
        return 0

    n = abs(n)
    
    number_of_divisors = 0
    
    # Iterate from 1 up to the square root of n
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            # If i is a divisor, n/i is also a divisor.
            # Check if the divisors are the same (in case of a perfect square)
            if n // i == i:
                number_of_divisors += 1
            else:
                number_of_divisors += 2
                
    return number_of_divisors
```