Site Tools
Sidebar
User's Manual
t2:ceil
ceil
ceil — Round fractions up
Description
fix32 ceil(fix32 num);
Returns the next highest integer value (as fix32) by rounding up num if necessary.
Parameters
- num: The numeric value to round.
Return Value
Returns num rounded to the next highest integer. The return value of floor() is still of type fix32 because the value range of fix32 is usually bigger than that of integer.
Examples
Example #1 ceil() example
init { printf("%.2f", ceil(4.3)); // 5.00 printf("%.2f", ceil(9.999)); // 10.00 printf("%.2f", ceil(-3.14)); // -3.00 }
See Also
t2/ceil.txt · Last modified: 2016/11/12 16:46 by J2Kbr