title: c# convert byte array to float and divide them by value
body: <p>I've a fallowing code which receives byte and probably has to perform convert to float and represent its converted values :</p>
  
  <pre><code> public float DecodeFloat(byte[] data)
      {
          float x = data[3]|data[2]&lt;&lt;8|data[1]&lt;&lt;16|data[0]&lt;&lt;24;
          return x;
      }
  
       // receive thread 
    private  void ReceiveData() 
      {
          int count=0;
  
         IPEndPoint remoteIP = new IPEndPoint(IPAddress.Parse("10.0.2.213"), port);
         client = new UdpClient(remoteIP);
          while (true) 
          {
             try 
              {
                  IPEndPoint anyIP = new IPEndPoint(IPAddress.Any, 0);
                  byte[] data = client.Receive(ref anyIP);
  
                  Vector3 vec,rot;
                  float x= DecodeFloat (data);
                  float y= DecodeFloat (data + 4);
                  float z= DecodeFloat (data + 8);
                  float alpha= DecodeFloat (data + 12);
                  float theta= DecodeFloat (data +16);
                  float phi= DecodeFloat (data+20);
  
                  vec.Set(x,y,z);
                  rot.Set (alpha,theta,phi);
  
  
                  print("&gt;&gt; " + x.ToString() + ", "+ y.ToString() + ", "+ z.ToString() + ", "
                      + alpha.ToString() + ", "+ theta.ToString() + ", "+ phi.ToString());
  
                  // latest UDPpacket
                  lastReceivedUDPPacket=x.ToString()+" Packet#: "+count.ToString();
                  count = count+1;
  
  
  
              }
  </code></pre>
  
  <p>Is there anyone to put me in the right way, please?</p>