Im trying to convert a large integer to a 32 bit single precision float but I can't get past this problem I'm having. What if the binary representation of the big integer is larger than the 23 bit mantissa.
For example, take the integer 1,671,277,287
Its binary representation is 01100011100111011010101011100111
My understanding is that you move the decimal place left until there is only 1 bit to the left of it like so:
01.100011100111011010101011100111
My problem is that this mantissa is 30 bits and a single precision float only has room for 23 bits of mantissa. I have tried looking for this specific problem but I haven't found anything. How would I tackle this?
EDIT: Found out some information just in case someone else has this problem. Default rounding for single precision float is "round to nearest, ties to even". Another StackOverflow post comments on how to do this easily.