pow


Description:

public double pow (double x, double y)

Returns the value of x raised to the power of y.

Note:

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

Example: Calculate x^y (double):

public static int main (string[] args) {
// Output: ``10^2 = pow (10, 2) = 100.000000``
double res = Math.pow (10, 2);
print ("10^2 = pow (10, 2) = %lf\n", res);
return 0;
}

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

Parameters:

x

A numeric value.

y

A numeric value.


Namespace: GLib.Math
Package: glib-2.0