def B_supp(n, s=1, dx=0, intsupp=False):
    """ Returns a min and max value of the domain on which the 1D cardinal B-spline of order n is non-zero.

        INPUT:
            - degree n, an integer

        INPUT (optional):
            - scale s, a real scalar number. Specifies the support of scaled B-splines via supp( B( . / s) )
            - offset dx, a real scalar number. Specifies the support of scaled+shifted B-splines via supp(B( . / s - dx)
            - intsupp, a boolean. Specifies whether or not the support should be on an integer grid. E.g. if xMax would
              be 2.3, and we only sample integer positions x. Then 2 would still be non-zero, but 3 would evaluate to
              zero. In this case the non-zero interval would be [-2,2] whereas in the intsupp=False case it would be
              [-2.3,2.3]

        OUTPUT:
            - (xMin, xMax), the min-max range of the support
    """
    xMinMax = s * (n + 1) / 2
    xMin = -xMinMax + dx
    xMax = xMinMax + dx
    if intsupp:
        xMax = (int(xMax) - 1 if int(xMax) == xMax else int(xMax))
        xMin = (int(xMin) + 1 if int(xMin) == xMin else int(xMin))
    return (xMin, xMax)