Jump to content

Floor()

From OpenBOR
Revision as of 15:26, 21 July 2026 by Dcurrent (talk | contribs) (Created page with "Accepts a numeric value and returns the largest integer less than or equal to the input using the C <code>floor()</code> function. Rounding proceeds downward toward negative infinity. For example, <code>floor(-3.8)</code> returns <code>-4</code>. <syntaxhighlight lang="c" line> float input = 3.8; int result = floor(input); // result = 3 </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 largest integer less than or equal to the input using the C floor() function. Rounding proceeds downward toward negative infinity.

For example, floor(-3.8) returns -4.

float input = 3.8;

int result = floor(input);

// result = 3