(self, den)
return exp, man, neg
Round the carry byte (to be used only in to_decimal).
Round the carry byte (to be used only in to_decimal).
Round the carry byte ( to be used only in to_decimal ) .
def _apply_carry_den(self, den):
        """Round the carry byte (to be used only in to_decimal)."""
        exp, man, neg = den
        # apply_carry()
        # carry bit set? then round up
        if (man & 0xff) > 0x7f:
            man += 0x100
        # overflow?
        if man >= self._den_upper:
            exp += 1
            man >>= 1
        # discard carry
        man ^= man & 0xff
        return exp, man, neg
def _apply_carry_den ( self , den ) : exp , man , neg = den # apply_carry() # carry bit set? then round up if ( man & 0xff ) > 0x7f : man += 0x100 # overflow? if man >= self . _den_upper : exp += 1 man >>= 1 # discard carry man ^= man & 0xff return exp , man , neg