ceil
Description:
Rounds x
up to the nearest integer.
Note:
Remember to link the math library: valac -X -lm ...
Example: Rounds x upward (double):
public static int main (string[] args) {
// Outpu: ``ceil (3.9) = 4.0``
print ("ceil (%.1lf) = %.1lf\n", 3.9, Math.ceil (3.9));
// Outpu: ``ceil (3.1) = 4.0``
print ("ceil (%.1lf) = %.1lf\n", 3.1, Math.ceil (3.1));
return 0;
}
valac --pkg glib-2.0 -X -lm GLib.Math.ceil.vala
Parameters:
x |
A numeric value. |
Namespace: GLib.Math
Package: glib-2.0