I have a need to implement a floating point package for small SBC and have most of the routines now working, but in the course of testing I have noticed that the algorithm in this 1 (attachment) will not (indeed cannot) produce the correct answer in the case where the divisor mantissa is all zeros, for the example 500/2 will produce the answer 255.0 rather than 250.0
01000000011111110100000000000000 = 0x43FA00 (500 base 10) and
01000000000000000000000000000000 = 0x400000 (2 base 10)
will produce
01000011011111111000000000000000 =0x437F0 (255 base 10)
Is there anyone who has a good knowledge of Floating Point arithmetic or indeed FP algorithms that can help out please?
[
]