User Tools

Site Tools


t2:floor

floor


floor — Round fractions down

Description


fix32 floor(fix32 num);

Returns the next lowest integer value (as fix32) by rounding down num if necessary.

Parameters


  • num: The numeric value to round.

Return Value


Returns num rounded to the next lowest 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 floor() example

init {
    printf("%.2f", floor(4.3));   // 4.00
    printf("%.2f", floor(9.999)); // 9.00
    printf("%.2f", floor(-3.14)); //-4.00
}

See Also

t2/floor.txt · Last modified: 2016/11/12 16:43 by J2Kbr