Rounding up a 0.0039 number

Since some variables inside shaders act weird with values less than 1/255 (0.0039), I was wondering there was a way of rounding it up to a nearest 1/255 number? The regular round-up does not work:


x=(round(x * 255)/255);


Is there an alternative to this function or a way to use variables that will not trigger errors with values less than 0.0039?

You are overcomplicating the problem and your proposed solution will not fix it. Just use better precision in the shader where you need it.