input: from typing import Union
  
  def convert_number(x: Union[int, float]) -> Union[int, float]:
      """ Convert a positive integer or float to its negative form or vice versa using the bitwise NOT operator.
      >>> convert_number(5)
      -5
      >>> convert_number(-5)
      5
      >>> convert_number(3.5)
      -3.5
      >>> convert_number(-3.5)
      3.5
      """
      if x >= 0:
          if isinstance(x, int):
              return ~x + 1
          else:
              return -x
      else:
          if isinstance(x, int):
              return ~(x - 1)
          else:
              return -x
output:     if x >= 0:
          if isinstance(x, int):
              return ~x + 1
          else:
              return -x
      else:
          if isinstance(x, int):
              return ~(x - 1)
          else:
              return -x