I am trying to write a function that takes in a 32-bit floating point number (that has been converted from a 32-bit binary string) and returns the previous representable float in 32-bit binary. So far I have the conversion from binary to float down, but I am having troubles understanding how to find the next representable IEEE 754 value. Can't you just subtract the smallest representable value possible (000 0000 0000 0000 0000 0001)? Also, what (if any) are the benefits of converting from IEEE 754 to Float before finding the closest representable binary value?
So far I only have a function that converts a floating point number to simple precision 32-bit binary. I would include my code, but this is for school so I feel iffy about putting it online/getting explicit corrections and advice.