<p>1.
How can I reinterpret cast a float to an int (or a double to a long)?</p>

<pre><code>float f = 2.0f;
int i = (int)f; // causes conversion
</code></pre>

<p>I only want to copy the bit-pattern from <code>f</code> to <code>i</code>. How can this be done?</p>

<p>2.
The implicit and explicit operators in C# uses one intermediate object because the operator function is static</p>

<pre><code>public static implicit operator MyClass(double s)
{
    return new MyClass(s);
} 
..
..
MyClass m = 2.2; // this code uses 'm' and one intermediate object.
</code></pre>

<p>This is fine for reference types, but for value-types which are big (say 20-30 bytes), this will cause unnecessary data copy. Is my understanding correct? And If yes, then why doesn't C# have a non-static conversion operator or user-defined assignment operator so that the conversion/assignment takes place on 'this'? If it does, whats the way to do it?</p>

The
BitConverter
class can retrieve the bytes for any primitive type, which you can then use to create an int. Another option is
Buffer.BlockCopy
if you have large amounts of converting to do.
```
```
float ff = 2.0f;
int ii = BitConverter.ToInt32(BitConverter.GetBytes(ff), 0);

float[] ff = new float[...];
int[] ii = new int[ff.Length];
Buffer.BlockCopy(ff, 0, ii, 0, ff.Length * 4); // byte-wise copy of ff into ii
```
```
No there is no other option given in C#, however, I think that while you're correct in the sense that there will be a copy made, any sufficiently simple implementation will have JIT optimizations done, possibly removing the need for a copy.