def fix_sign(x, N=360 * 60 * 10):
    """
    Convert negative tenths of arcminutes *x* to positive by checking
    bounds and taking the modulus N (360 degrees * 60 minutes per
    degree * 10 tenths per 1).
    """
    if x < 0:
        assert x > -N
        x += N
    assert x < N
    return x % N