FixedDiv

From ZDoom Wiki

Jump to: navigation, search

int FixedDiv (int a, int b)

Usage

Returns the fixed point result of dividing fixed point a by fixed point number b.

Parameters

  • a
The fixed point divident.
  • b
The fixed point divider.

Return value

The result of fixed point numbers dividing.

Examples

You can't use normal division operator on fixed point numbers when you expect the result to be fixed point number too. See the results of this example:

script 1 (void)
{
    Print (f: FixedDiv (1.0, 0.5)); // 2
    Print (f: 1.0 / 0.5);           // 0.000030518
}
Personal tools