IEEE 754 for integer
IEEE 754 is the specification for floating point values. Integers aren't floating point values so this function of yours can have nothing to do with integers.

On an Arduino (8-bit):


A float value is 4 bytes in IEEE-754 format.
A long value is 4 bytes in little-endian format.
An int value is 2 bytes in little-endian format.
A byte is a byte.


To convert 4 bytes into a long you can use:

long val = (payload[3] &lt;&lt; 24) | (payload[2] &lt;&lt; 16) | (payload[1] &lt;&lt; 8) | payload[0];


An int value is just the lower two bytes of the same kind of conversion:

int val = (payload[1] &lt;&lt; 8) | payload[0];


You can use the same method (albeit backwards) to get the bytes to put in your payload:

long val = 12345678L
payload[0] = val &amp; 0xFF;
payload[1] = (val &gt;&gt; 8) &amp; 0xFF;
payload[2] = (val &gt;&gt; 16) &amp; 0xFF;
payload[3] = (val &gt;&gt; 24) &amp; 0xFF;


You can also use the same technique as your existing function with different datatypes, since all you care about is the byte content not the format or meaning of the bits within it:

void int2payload( int val, int pos) {
  byte* array = (byte*) &amp;val;
  for (int i = 0 ; i &lt; 2 ; i++) {
      payload[pos + i] = array[i];
  }
}

void long2payload( long val, int pos) {
  byte* array = (byte*) &amp;val;
  for (int i = 0 ; i &lt; 4 ; i++) {
      payload[pos + i] = array[i];
  }
}