Q_IRAWMASK(3)

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

πŸ’… Q_IRAWMASK(3) β€” the library-functions-manual girlypop edition πŸŽ€

okay so bestie, we're in section 3 of the library functions manual and this page is literally about the fixed-point math functions that mess with the integer data bits. no cap. let's get into it πŸ¦‹


✨ NAME ✨

Q_IRAWMASK, Q_GIRAW, Q_GIABSVAL, Q_GIVAL, Q_SIVAL β€” fixed-point math functions which manipulate the integer data bits 🌸

like, they don't touch the fractional vibes at all, they're strictly here for the integer bits. main character energy tbh πŸ‘‘


🌈 SYNOPSIS 🌈

#include <sys/qmath.h>

ITYPE
Q_IRAWMASK(QTYPE q);

ITYPE
Q_GIRAW(QTYPE q);

ITYPE
Q_GIABSVAL(QTYPE q);

ITYPE
Q_GIVAL(QTYPE q);

QTYPE
Q_SIVAL(QTYPE q, ITYPE iv);

yes the include is #include <sys/qmath.h>, write it down, don't @ me 🫢


πŸ’– DESCRIPTION πŸ’–

so here's the whole squad, one by one:

  • Q_IRAWMASK() β€” returns a q-specific bit mask for q's integer data bits. it's giving "here's the mask that belongs to your q" ✨
  • Q_GIRAW() β€” returns q's raw masked integer data bits. raw. masked. integer. bits. all four πŸ“
  • Q_GIABSVAL() and Q_GIVAL() β€” these two besties return the absolute and real values of q's integer data bits respectively πŸ™ˆ (yes, respectively β€” absolute first, real second, keep the order!)
  • Q_SIVAL() β€” sets q's integer data bits to the value iv. the setter of the group πŸ’…

and the tea on the types β˜•: all of those functions operate on the following data types:

  • s8q_t
  • u8q_t
  • s16q_t
  • u16q_t
  • s32q_t
  • u32q_t
  • s64q_t
  • u64q_t

which are referred to generically as QTYPE. and ITYPE refers to the stdint(7) integer types. iykyk 🧚

for more details, see qmath(3). go read it, i'll wait πŸ’œ


⭐ RETURN VALUES ⭐

  • Q_IRAWMASK(), Q_GIRAW(), Q_GIABSVAL() and Q_GIVAL() return their respective values as integers of the same underlying ITYPE as q. same underlying type, always β€” no sneaky conversions πŸ”₯
  • Q_SIVAL() returns the value of q post change. post! change! like after the glow-up πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹

errno(2), qmath(3), stdint(7)

(the friend group πŸ‘―β€β™€οΈ go say hi)


🌸 HISTORY 🌸

the qmath(3) functions first appeared in FreeBSD 13.0. iconic debut, no notes πŸ‘‘


πŸŽ€ AUTHORS πŸŽ€

the qmath(3) functions and this manual page were written by Lawrence Stewart <lstewart@FreeBSD.org> and sponsored by Netflix, Inc. β€” yes that Netflix, we stan a sponsored manpage πŸΏπŸ’…


ok that's the whole page fr fr β€” every flag, type, and reference accounted for, nothing skipped, nothing invented. vibe check: passed βœ…

and that's the wrap bestie πŸ’œ this lil beauty is from the Debian fam, dated July 8, 2018, filed right back under Q_IRAWMASK(3) β€” mwah, see u in the next manpage 😘🫢

πŸ“¦ where this page comes from