Q_QABS(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… Q_QABS(3) πŸ’…

okay so bestie, welcome to the Library Functions Manual page for Q_QABS(3) β€” fixed-point math but make it group-chat cute. No cap, every single detail is staying. πŸ’–


πŸŽ€ NAME πŸŽ€

Q_QABS, Q_Q2S, Q_Q2F β€” fixed-point math functions which operate on a single Q number. periodt. ✨


✨ SYNOPSIS ✨

like, include this header and you're in business:

#include <sys/qmath.h>

QTYPE
Q_QABS(QTYPE q);

double
Q_Q2D(QTYPE q);

float
Q_Q2F(QTYPE q);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so Q_QABS() is the absolute-value girlie: it returns an absolute value representation of q. πŸ’…

Q_Q2D() and Q_Q2F() are the converter besties β€” they 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. literally the whole squad. 🌈

For more details, see qmath(3). iykyk. 🌸


πŸ”₯ RETURN VALUES πŸ”₯

The 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. that's the handoff, bestie. ✨


🌈 SEE ALSO 🌈

go peek at these when you need the lore. πŸ‘‘


⭐ HISTORY ⭐

The qmath(3) functions first appeared in FreeBSD 13.0. iconic origin story. πŸ’€


πŸ‘‘ AUTHORS πŸ‘‘

The qmath(3) functions and this manual page were written by Lawrence Stewart <lstewart@FreeBSD.org> and sponsored by Netflix, Inc. slay. πŸŽ€


mwah πŸ’‹ β€” this page comes from Debian, dated July 8, 2018, and the manual tag is Q_QABS(3).

πŸ“¦ where this page comes from