---
name: "fixmul"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/fixmul"
---

# fixmul(3alleg)

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

## 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.

## SEE ALSO

[**fixadd**(3alleg)](/fixadd/3alleg.md), [**fixsub**(3alleg)](/fixsub/3alleg.md), [**fixdiv**(3alleg)](/fixdiv/3alleg.md), [**ex3buf**(3alleg)](/ex3buf/3alleg.md), [**excustom**(3alleg)](/excustom/3alleg.md), [**exfixed**(3alleg)](/exfixed/3alleg.md), [**exspline**(3alleg)](/exspline/3alleg.md), [**exstars**(3alleg)](/exstars/3alleg.md), [**exupdate**(3alleg)](/exupdate/3alleg.md)
