You can use the BitConverter
class:
uint value = BitConverter.ToUInt32(BitConverter.GetBytes(44.54321F), 0);
Console.WriteLine("{0:x}", value); // 42322c3f
You could also do this more directly using an unsafe
context:
float floatVal = 44.54321F;
uint value;
unsafe {
value = *((uint*)(&floatVal));
}
Console.WriteLine("{0:x}", value); // 42322c3f
However, I'd strongly recommend avoiding this. See Should you use pointers (unsafe code) in C#?