0x069
09-15-2010, 12:12 AM
Hello,
I want to ask - Why in GLSL was such design decision to make fract() function as
x-floor(x) because it gives "incorrect" fraction values for negative arguments. Correct fract() implementation should be like this:
if (x>=0.)
return x-floor(x)
else
return x-ceil(x)
Anybody knows such fract() design decision ??
Thanks in advance.
I want to ask - Why in GLSL was such design decision to make fract() function as
x-floor(x) because it gives "incorrect" fraction values for negative arguments. Correct fract() implementation should be like this:
if (x>=0.)
return x-floor(x)
else
return x-ceil(x)
Anybody knows such fract() design decision ??
Thanks in advance.