The packing method

In the packing method, all numbers are first converted to integers by multiplying the original number with 10**IPREC, a user specified quantity. They are then truncated at the decimal point. The minimum offset to make all numbers positive is then found and added to each value. The optimum packing factor is then determined. This factor is chosen so that the minimum number of words are used after packing. The data is then packed, except for those words which cannot be stored with the chosen packing factor, which are stored in 32 bit words. Here again 3 extra words are used to keep useful information, as follows:

  1. The number of data words *10**4 + original data type*1000 + (IPREC+100) The data type is indicated as follows:
    2
    Integer
    3
    Floating point
  2. The offset to make all the numbers positive
  3. A packed word with bits 1-26 = number of words stored as 32-bit words, bits 27-31 = number of bits used in packing, bit 32 set to distinguish from the other methods.