code: def to_sortable(numtype, intsize, signed, x):
      if numtype is int or numtype is long_type:
          if signed:
              x += 1 << intsize - 1
          return x
      else:
          return float_to_sortable_long(x, signed)
  
imports: import math, struct
  from array import array
  from bisect import bisect_left
  from struct import pack, unpack
  from whoosh.compat import b, long_type
  from whoosh.system import pack_byte, unpack_byte, pack_ushort, unpack_ushort
  from whoosh.system import pack_int, unpack_int, pack_uint, unpack_uint
  from whoosh.system import pack_long, unpack_long, pack_ulong, unpack_ulong
  from whoosh.system import pack_float, unpack_float, pack_double, unpack_double
label_desc: Use image node_id 5 for calling a global function with example usage: to_sortable(numtype, intsize, signed, x) and returns: x, float_to_sortable_long