Example: Calculate x^y (float)

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

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

See:




2022 vala-language.org