t2:mod

mod


mod — Remainder of a fix32 division

Description


fix32 mod(fix32 num, fix32 div);

Returns the fix32 remainder of dividing the dividend num by the divisor div.

Parameters


  • num: The dividend.
  • div: The divisor.

Return Value


The fix32 remainder of num / div.

Examples


Example #1 mod() example

init {
    printf("%.1f", mod(5.7, 1.3)); // 0.5, because 4 * 1.3 + 0.5 = 5.7
}
t2/mod.txt · Last modified: 2017/01/22 05:23 by J2Kbr