The line:
Code:
x = 1.0 + x / 256.0;
casts it as floating point. If you haven't used floating point math, you have your research cut out for you.