'Rounds to the nearest integer, without raising inexact, rounded.'

def to_integral_value(self, rounding=None, context=None):

    if (context is None):
        context = getcontext()
    if (rounding is None):
        rounding = context.rounding
    if self._is_special:
        ans = self._check_nans(context=context)
        if ans:
            return ans
        return Decimal(self)
    else:
        if (self._exp >= 0):
            return Decimal(self)
        return self._rescale(0, rounding)
        return
