def decimal_tuple(d):
    """
    Return a tupple (sign, integral, fractional)
    corresponding to the given decimal number.

    This is different from the `as_tuple` method that
    returns the mantisa and the exponent
    """
    sign, digits, exponent = d.normalize().as_tuple()
    n = len(digits)+exponent
    if n < 0:
        digits = (0,)*-n + digits
    elif exponent >= 0:
        digits = digits + (0,)*exponent
        exponent = len(digits)

    return sign, digits[:exponent], digits[exponent:]