input: Write a python function to convert a decimal number to its binary representation.
  assert decimal_to_binary(10.625) == "1.1010"
  assert decimal_to_binary(3.5) == "1.11"
  assert decimal_to_binary(0.125) == "1.0001"
output: def decimal_to_binary(num):
      if num == 0:
          return "0"
      
      integer_part = int(num)
      fractional_part = num - integer_part
      
      binary_integer = bin(integer_part)[2:]
      
      binary_fractional = []
      while fractional_part and len(binary_fractional) <= 32:
          fractional_part *= 2
          bit = int(fractional_part)
          binary_fractional.append(str(bit))
          fractional_part -= bit
      
      if not binary_fractional:
          return binary_integer
      else:
          return binary_integer + "." + "".join(binary_fractional)