---
name: "al_itofix"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_itofix"
---

# al\_itofix(3)

Allegro 5 API

## NAME

al\_itofix - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  al_fixed al_itofix(int x);
  ```

## DESCRIPTION

Converts an integer to fixed point. This is the same thing as x\<\<16. Remember that overflows (trying to convert an integer greater than 32767) and underflows (trying to convert an integer lesser than -32768) are not detected even in debug builds! The values simply “wrap around”.

Example:

-

  ```
  al_fixed number;
  /* This conversion is OK. */
  number = al_itofix(100);
  assert(al_fixtoi(number) == 100);
  number = al_itofix(64000);
  /* This check will fail in debug builds. */
  assert(al_fixtoi(number) == 64000);
  ```

## RETURN VALUE

Returns the value of the integer converted to fixed point ignoring overflows.

## SEE ALSO

[al\_fixtoi(3)](/al_fixtoi/3.md), [al\_ftofix(3)](/al_ftofix/3.md), [al\_fixtof(3)](/al_fixtof/3.md).
