Operator '%' doesn't work on floats?

I’m trying to do a modulo on two floats, but the shader compiler complains.

error(#162) Wrong operand types no operation ‘%’ exists that takes a left-hand operand of type ‘float’ and a right operand of type ‘float’ (or there is no acceptable conversion).

The code that causes this is:

vec2 pixelOffset = vec2(shadowCoord.x % invShadowSize, shadowCoord.y % invShadowSize);

It is strange that the modulo operation does not work on floats, it certianly does in DirectX.

Isn’t that written as mod on the reference card ?

EDIT: yes it is : http://www.opengl.org/documentation/specs/

You’re right, the mod() function works.

That makes me wonder why openGL didn’t do away with either the operator or the function, and just use 1 of them.