HomeFreeBSD

Introduce <sys/qmath.h>, a fixed-point math library from Netflix.


Description

Introduce <sys/qmath.h>, a fixed-point math library from Netflix.

This makes it possible to perform mathematical operations
on
fractional values without using floating point. It operates on Q
numbers, which are integer-sized, opaque structures initialized
to hold a chosen number of integer and fractional
bits.


For a general description of the Q number system, see the "Fixed Point
Representation & Fractional Math" whitepaper[1]; for the actual
API see the qmath(3) man page.

This is one of dependencies for the upcoming stats(3) framework[2]
that will be applied to the TCP stack in a later commit.

  1. https://www.superkits.net/whitepapers/Fixed%20Point%20Representation%20&%20Fractional%20Math.pdf
  2. https://reviews.freebsd.org/D20477

Reviewed by: bcr (man pages, earlier version), sef (earlier version)
Discussed with: cem, dteske, imp, lstewart
Sponsored By: Klara Inc, Netflix
Obtained from: Netflix
Differential Revision: https://reviews.freebsd.org/D20116

Details

Provenance
traszAuthored on
Reviewer
bcr
Differential Revision
D20116: Introduce <sys/qmath.h>
Parents
rS351543: Add support for RK3288 into existing RockChip drivers.
Branches
Unknown
Tags
Unknown