Lines Matching defs:Decimal
7 from decimal import Decimal
37 (?:\.(?P<decimal>\d*))? # an optional fractional part
59 - float and Decimal instances
89 >>> Fraction('-47e-2') # string may include a decimal exponent
95 >>> Fraction(Decimal('1.47'))
114 elif isinstance(numerator, Decimal):
132 decimal = m.group('decimal')
133 if decimal:
134 scale = 10**len(decimal)
135 numerator = numerator * scale + int(decimal)
186 """Converts a finite Decimal instance to a rational number, exactly."""
187 from decimal import Decimal
189 dec = Decimal(int(dec))
190 elif not isinstance(dec, Decimal):