---
name: "Q_GFVAL"
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_FRAWMASK"
---

# Q\_GFVAL(3)

fixed-point math functions which manipulate the fractional data bits

Part of [Q\_FRAWMASK(3)](/Q_FRAWMASK/3.md).

## NAME

**Q\_FRAWMASK**, **Q\_GFRAW**, **Q\_GFABSVAL**, **Q\_GFVAL**, **Q\_SFVAL** – fixed-point math functions which manipulate the fractional data bits

## SYNOPSIS

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

*ITYPE*\

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

*ITYPE*\

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

*ITYPE*\

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

*ITYPE*\

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

*QTYPE*\

**Q\_SFVAL**(*QTYPE q*, *ITYPE fv*);

## DESCRIPTION

**Q\_FRAWMASK**() returns a *q*-specific bit mask for *q*'s fractional data bits.

**Q\_GFRAW**() returns *q*'s raw masked fractional data bits.

**Q\_GFABSVAL**() and **Q\_GFVAL**() return the absolute and real values of *q*'s fractional data bits respectively.

**Q\_SFVAL**() sets *q*'s fractional data bits to the value *fv*.

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*. The *ITYPE* refers to the [stdint(7)](/stdint/7.md) integer types.

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

## RETURN VALUES

**Q\_FRAWMASK**(), **Q\_GFRAW**(), **Q\_GFABSVAL**() and **Q\_GFVAL**() return their respective values as integers of the same underlying ITYPE as *q*.

**Q\_SFVAL**() returns the value of *q* post set.

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