docs: def float_to_fix(signed, n_bits, n_frac):
      """**DEPRECATED** Return a function to convert a floating point value to a
      fixed point value.
  
      .. warning::
          This function is deprecated in favour of :py:meth:`~.float_to_fp`.
  
      For example, a function to convert a float to a signed fractional
      representation with 8 bits overall and 4 fractional bits (S3.4) can be
      constructed and used with::
  
          >>> s34 = float_to_fix(signed=True, n_bits=8, n_frac=4)
          >>> hex(s34(0.5))
          '0x8'
  
      The fixed point conversion is saturating::
  
          >>> q34 = float_to_fix(False, 8, 4)  # Unsigned 4.4
          >>> hex(q34(-0.5))
          '0x0'
  
          >>> hex(q34(15.0))
          '0xf0'
  
          >>> hex(q34(16.0))
          '0xff'
  
      Parameters
      ----------
      signed : bool
          Whether the values that are to be converted should be signed, or
          clipped at zero.
  
              >>> hex(float_to_fix(True, 8, 4)(-0.5))  # Signed
              '0xf8'
              >>> hex(float_to_fix(False, 8, 4)(-0.5))  # Unsigned
              '0x0'
  
          .. note::
              Regardless of the value of the `signed` parameter the returned
              value is always an unsigned integer suitable for packing with the
              struct packing chars `B`, `H`, `I` etc.
  
      n_bits : int
          Total number of bits in the fixed-point representation (including sign
          bit and fractional bits).
      n_frac : int
          Number of fractional bits in the fixed-point representation.
  
      Raises
      ------
      ValueError
          If the number of bits specified is not possible.  For example,
          requiring more fractional bits than there are bits overall will result
          in a `ValueError`::
  
              >>> fix_to_float(False, 8, 9)
              Traceback (most recent call last):
              ValueError: n_frac: 9: Must be less than 8 (and positive).
      """
      warnings.warn("float_to_fix() is deprecated, see float_to_fp",
                    DeprecationWarning)
  
      mask = int(2**n_bits - 1)
      min_v, max_v = validate_fp_params(signed, n_bits, n_frac)
  
      # Saturate values
      def bitsk(value):
          """Convert a floating point value to a fixed point value.
  
          Parameters
          ----------
          value : float
              The value to convert.
          """
          value = np.clip(value, min_v, max_v)
  
          if value < 0:
              fp_val = (1 << n_bits) + int(value * 2**n_frac)
          else:
              fp_val = int(value * 2**n_frac)
  
          assert 0 <= fp_val < 1 << (n_bits + 1)
          return fp_val & mask
  
      return bitsk