Float variable and BitMask

Dear all,
I need to create a packet of data in a binary array. Thus, I tried to store a float variable (i.e. temp) into a binary variable (i.e. packet) using a BitMask as follow:

packet[0] = (temp & 0xFF000000) >> 24;
packet[1] = (temp & 0x00FF0000) >> 16;
packet[2] = (temp & 0x0000FF00) >> 8;
packet[3] = (temp & 0x000000FF);

However, I received the following error message:

invalid operands of types 'float' and 'long unsigned int' to binary 'operator&'

   packet[0] = (temp & 0xFF000000) >> 24;

                       ^

exit status 1
invalid operands of types 'float' and 'long unsigned int' to binary 'operator&'

Thank you in advance for your help.
I am not familiar with this technique, but I need it to send data throught a LoRa connection.

Best Regards

Does it make any sense to apply a bitwise operator between a float and an int ?
What do you expect the result of temp & 0xFF000000 to be, for example ?

I expect to do this:

before (temp & 0xFF000000) >> 24
| AE | 00 | 00 | 00 |

after (temp & 0xFF000000) >> 24
| 00 | 00 | 00 | AE |

  *(float*)(&packet[0]) = temp;

A coin flip will determine if an endian problem is lurking.