FixedMul

From ZDoom Wiki
Revision as of 00:21, 6 November 2013 by Deded007 (talk | contribs) (Links, and see also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

fixed FixedMul (int a, int b)

Usage

Returns the fixed point result of multiplying two fixed point numbers.

Parameters

Return value

The result of fixed point numbers multiplication.

Examples

You cannot use normal multiplication operator on fixed point numbers. See the results of this example:

script 1 (void)
{
    Print (f: FixedMul (0.5, 0.5)); // 0.25
    Print (f: 0.5 * 0.5);           // 16384
}

However, multiplying a fixed point number a by an integer b yields a fixed point value still, and one must not use FixedMul in this case:

script 2 (void)
{
        int z = 1.2 * 3;
        print(f:z);                  /* 3.6 or so */
}

See also