floor


Description:

public double floor (double x)

Rounds x down to the nearest integer.

Note:

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

Example: Rounds x downward (double):

public static int main (string[] args) {
// Output:
// ``floor (3.1) = 3.0``
// ``floor (3.9) = 3.0``
print ("floor (%.1lf) = %.1lf\n", 3.1, Math.floor (3.1));
print ("floor (%.1lf) = %.1lf\n", 3.9, Math.floor (3.9));
return 0;
}

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

Parameters:

x

A numeric value.


Namespace: GLib.Math
Package: glib-2.0