title: How to create a custom float with varying bit length
body: <p>I'm writing a program that basically converts an int into a floating point with a twist, the user specifies how many bits are used for the exponent and mantissa part. I don't understand what the algorithm for taking a number and breaking it into an exponent and mantissa is though. If I go to an IEEE 754 Converter and type in 34, it changes it to exp 2^5 and mantissa 1.0625, but I don't understand how to get this conversion. I know what I'll do to then get the bits in the specified places, but I don't know how to get the correct bits in the first place</p>