acosf


Description:

public float acosf (float x)

Calculates the arc cosine of x.

Note:

Remember to link the math library: valac -X -lm ...

That is the value whose cosine is x. If x falls outside the range -1 to 1, GLib.Math.acosf fails and GLib.errno is set to EDOM.

Example: Arc cosine (float):

public static int main (string[] args) {
// Output: ``acosf (0.500000f) = 1.047198f``
float x = 0.5f;
float res = Math.acosf (x);
print("acosf (%lff) = %lff\n", x, res);


// Output: ``acosf (1.000000f) = 0.000000f``
x = 1;
res = Math.acosf (x);
print("acosf (%lff) = %lff\n", x, res);


// Output: ``acosf (2.000000f) = nanf``
x = 2;
res = Math.acosf (x);
print("acosf (%lff) = %lff\n", x, res);

return 0;
}

valac --pkg glib-2.0 -X -lm GLib.Math.acosf.vala


Namespace: GLib.Math
Package: glib-2.0