def dxrange(start, end=None, inc=None, include_end=False):
    """ The xrange function for Decimal """
    from decimal import Decimal
    assert inc != 0, 'inc should not be zero'
    if end is None:
        end = start
        start = 0
    if inc is None:
        inc = 1
    inc = Decimal(inc)
    start = Decimal(start)
    end = Decimal(end)
    nextv = start
    while True:
        if inc > 0 and (not include_end and nextv == end or nextv > end
            ) or inc < 0 and (not include_end and nextv == end or nextv < end):
            break
        yield nextv
        nextv += inc
