code: def float_to_decimal(f):
      
      n, d = f.as_integer_ratio()
      numerator, denominator = Decimal(n), Decimal(d)
      return DECIMAL_CONTEXT.divide(numerator, denominator)
docs: Convert a float to a 38-precision Decimal