math with Gl datatypes

how do i perform standard math functions like abs() or sqrt() on something like GLfloat ?

Actually this is pretty simple, head over gl.h to see how GLfloat is defined, in fact it is a good old float.

Originally posted by ZbuffeR:
Actually this is pretty simple, head over gl.h to see how GLfloat is defined, in fact it is a good old float.
well i see its a float, but it still doenst compile when i try to perform abs(GLfloat number)
or any other function from math.h library :frowning:

try this, maybe forget about r1 :

GLfloat f1 =0.3f;
float r1;
double r2;
r1 = abs((float)f1);
r2 = abs((double)f1);