asin


Description:

public double asin (double x)

Calculates the arc sine of x.

Note:

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

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

Example: Arc sine (double):

public static int main (string args[]) {
// Output: ``asin (0.289000) = 0.293182``
double x = 0.289;
double res = Math.asin (x);
print ("asin (%lf) = %lf\n", x, res);


// Output: ``asin (0.000000) = 0.000000``
x = 0;
res = Math.asin (x);
print ("asin (%lf) = %lf\n", x, res);


// Output: ``asin (-2.000000) = nan``
x = -2;
res = Math.asin (x);
print ("asin (%lf) = %lf\n", x, res);

return 0;
}

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


Namespace: GLib.Math
Package: glib-2.0