title: Cast float to int without ANY conversion?
body: <p>I am writing various types to a byte stream by manually casting and shifting values. I have found this to be more than three times faster than using BitConverter or BinaryWriter.</p>
  
  <p>My problem is with floats. I need to cast them to ints in order to perform shift operations on them, but any cast to int will cause an implicit conversion with truncation, etc. I want the keep the exact binary representation the same. Is this possible?</p>
  
  <p>eg. I want to be able to do similar to:</p>
  
  <pre><code>byte[] bytes = new byte[4];
  float myFloat = 32.2;
  
  //following won't compile as can't shift floats.
  bytes [0] = (byte)myFloat;
  bytes [1] = (byte)(myFloat &gt;&gt; 8);
  bytes [2] = (byte)(myFloat &gt;&gt; 16);
  bytes [3] = (byte)(myFloat &gt;&gt; 24);
  </code></pre>