logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Author

       Generated automatically by Doxygen for DPDK from the source code.

DPDK                                             Version 24.11.2                                 rte_approx.h(3)

Detailed Description

       RTE Rational Approximation

       Given a rational number alpha with 0 < alpha < 1 and a precision d, the goal is to find positive integers
       p, q such that alpha - d < p/q < alpha + d, and q is minimal.

       Definition in file rte_approx.h.

Function Documentation

intrte_approx(doublealpha,doubled,uint32_t*p,uint32_t*q)
       Find best rational approximation

       Parametersalpha Rational number to approximate
           d Precision for the rational approximation
           p Pointer to pre-allocated space where the numerator of the rational approximation will be stored
           when operation is successful
           q Pointer to pre-allocated space where the denominator of the rational approximation will be stored
           when operation is successful

       Returns
           0 upon success, error code otherwise

   intrte_approx_64(doublealpha,doubled,uint64_t*p,uint64_t*q)
       Find best rational approximation (64 bit version)

       Parametersalpha Rational number to approximate
           d Precision for the rational approximation
           p Pointer to pre-allocated space where the numerator of the rational approximation will be stored
           when operation is successful
           q Pointer to pre-allocated space where the denominator of the rational approximation will be stored
           when operation is successful

       Returns
           0 upon success, error code otherwise

Name

       rte_approx.h

Synopsis

       #include <stdint.h>

   Functions
       int rte_approx (double alpha, double d, uint32_t *p, uint32_t *q)
       int rte_approx_64 (double alpha, double d, uint64_t *p, uint64_t *q)

See Also