Originally Posted by

**syner** Lol surley there must be some sort of way that you worked out the binary.

I know how to work from binary to hex, vice versa, floating point representation (now after abit of study)

but this is the one bit that i am stumped at, what working did you use to get the binary value?

Lol still abit lost to how i figure out the relative and absolute error, sorry i think i suffer from maths dislexia

Greedy algorithm:

Code:

x: real <1 //input is a real less than 1
max=24 //number of bits required
out="" //set output to null string
for idx=1 to max
if x>=1/2 //if x>=1/2 tag a 1 onto end of output string
out=out|"1" //and reduce x by 1/2
x=x-1/2
else
out=out|"0" //if x<1/2 tag a 0 onto end of output string
endif
endfor
return out

RonL