Jump to content

Ceil()

From OpenBOR
Revision as of 15:25, 21 July 2026 by Dcurrent (talk | contribs) (Created page with "Accepts a numeric value and returns the smallest integer greater than or equal to the input using the C <code>ceil()</code> function. Rounding proceeds upward toward positive infinity. For example, <code>ceil(-3.8)</code> returns <code>-3</code>. <syntaxhighlight lang="c" line> float input = 3.2; int result = ceil(input); // result = 4 </syntaxhighlight> Category:OpenBOR Index Category:Script Functions Category:Math")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Accepts a numeric value and returns the smallest integer greater than or equal to the input using the C ceil() function. Rounding proceeds upward toward positive infinity.

For example, ceil(-3.8) returns -3.

float input = 3.2;

int result = ceil(input);

// result = 4