---
name: "Q_QABS"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/Q_Q2D"
---

# Q\_QABS(3)

fixed-point math functions which operate on a single Q number

Part of [Q\_Q2D(3)](/Q_Q2D/3.md).

## NAME

**Q\_QABS**, **Q\_Q2S**, **Q\_Q2F** – fixed-point math functions which operate on a single Q number

## SYNOPSIS

**#include \<sys/qmath.h\>**

*QTYPE*\

**Q\_QABS**(*QTYPE q*);

*double*\

**Q\_Q2D**(*QTYPE q*);

*float*\

**Q\_Q2F**(*QTYPE q*);

## DESCRIPTION

The **Q\_QABS**() function returns an absolute value representation of *q*.

The **Q\_Q2D**() and **Q\_Q2F**() functions return the double and float representations of *q* respectively.

All of those functions operate on the following data types: *s8q\_t*, *u8q\_t*, *s16q\_t*, *u16q\_t*, *s32q\_t*, *u32q\_t*, *s64q\_t*, and *u64q\_t*, which are referred to generically as *QTYPE*.

For more details, see [qmath(3)](/qmath/3.md).

## RETURN VALUES

**Q\_QABS**() function returns a QTYPE that is identical to that of *q*.

The **Q\_Q2D**() and **Q\_Q2F**() functions return the double and float representations of *q* respectively.

## SEE ALSO

[errno(2)](/errno/2.md), [qmath(3)](/qmath/3.md), [stdint(7)](/stdint/7.md)

## HISTORY

The [qmath(3)](/qmath/3.md) functions first appeared in FreeBSD 13.0.

## AUTHORS

The [qmath(3)](/qmath/3.md) functions and this manual page were written by Lawrence Stewart ⟨*lstewart@FreeBSD.org*⟩ and sponsored by Netflix, Inc.
