(n)
Same behavior as _canonical_decimal, but also accepts small values in
    scientific notation, rounding them to zero
Same behavior as _canonical_decimal, but also accepts small values in
    scientific notation, rounding them to zero
Same behavior as _canonical_decimal but also accepts small values in scientific notation rounding them to zero
def _canonical_decimal_round_tiny_exp(n):
    """
    Same behavior as _canonical_decimal, but also accepts small values in
    scientific notation, rounding them to zero

    """
    exp_match = re.match(r'^-?\d.\d+E-(\d)$', n)
    if exp_match:
        e = int(exp_match.group(1))
        if e < 4:
            raise ValueError('Hack for scientific notation only works for '
                             'negative exponents 4 and above: {!r}'.format(n))
        else:
            return Decimal('0')
    else:
        return _canonical_decimal(n)
def _canonical_decimal_round_tiny_exp ( n ) : exp_match = re . match ( r'^-?\d.\d+E-(\d)$' , n ) if exp_match : e = int ( exp_match . group ( 1 ) ) if e < 4 : raise ValueError ( 'Hack for scientific notation only works for ' 'negative exponents 4 and above: {!r}' . format ( n ) ) else : return Decimal ( '0' ) else : return _canonical_decimal ( n )