#
fixmul (3) - Linux Man Pages

## fixmul: Multiplies two fixed point values together. Allegro game programming library.

Command to display `fixmul`

manual in Linux: `$ man 3 fixmul`

## NAME

fixmul - Multiplies two fixed point values together. Allegro game programming library.

## SYNOPSIS

**#include <allegro.h>**

**fixed fixmul(fixed x, fixed y);**

## DESCRIPTION

A fixed point value can be multiplied or divided by an integer with the
normal `*' and `/' operators. To multiply two fixed point values, though,
you must use this function.

If an overflow occurs, `errno' will be set and the maximum possible value
will be returned, but `errno' is not cleared if the operation is
successful. This means that if you are going to test for overflow you
should set `errno=0' before calling fixmul(). Example:

fixed result;
/* This will put 30000 into `result'. */
result = fixmul(itofix(10), itofix(3000));
/* But this overflows, and sets `errno'. */
result = fixmul(itofix(100), itofix(3000));
ASSERT(!errno);

## RETURN VALUE

Returns the clamped result of multiplying `x' by `y', setting `errno' to
ERANGE if there was an overflow.

## Pages related to fixmul

- fix_filename_case (3) - Converts a filename to a standardised case. Allegro game programming library.
- fix_filename_slashes (3) - Converts all the directory separators to a standard character. Allegro game programming library.
- fixacos (3) - Fixed point inverse cosine lookup table. Allegro game programming library.
- fixadd (3) - Safe function to add fixed point numbers clamping overflow. Allegro game programming library.
- fixasin (3) - Fixed point inverse sine lookup table. Allegro game programming library.
- fixatan (3) - Fixed point inverse tangent lookup table. Allegro game programming library.
- fixatan2 (3) - Fixed point version of the libc atan2() routine. Allegro game programming library.
- fixceil (3) - Returns the smallest integer not less than x. Allegro game programming library.