60 extern const struct _qFP16_const_s
qFP16;
69 #define qFP16_Constant(x) \
70 ( (qFP16_t)( ( (x) >= 0 ) ? ( (x) * 65536.0F + 0.5F ) \
71 : ( (x) * 65536.0F - 0.5F ) ) ) \
82 uint8_t rounding, saturate;
qFP16_t qFP16_Mod(const qFP16_t x, const qFP16_t y)
Returns the fixed-point modulo operation x % y.
Definition qfp16.c:358
qFP16_t qFP16_Sqrt(qFP16_t x)
Returns the fixed-point square root of x.
Definition qfp16.c:370
qFP16_t qFP16_Atan2(const qFP16_t y, const qFP16_t x)
Computes the fixed-point arc tangent in radians of y / x based on the signs of both values to determi...
Definition qfp16.c:607
char * qFP16_FPToA(const qFP16_t num, char *str, int decimals)
Converts the fixed-point value to a formatted string.
Definition qfp16.c:806
int32_t qFP16_t
Fixed-point Q16.16 type with width of exactly 32 bits.
Definition qfp16.h:25
qFP16_t qFP16_Polyval(const qFP16_t *const p, const size_t n, const qFP16_t x)
Evaluates the fixed-point polynomial p at the point x. The argument p is a vector of length n+1 whose...
Definition qfp16.c:734
qFP16_t qFP16_Exp(qFP16_t x)
Returns the fixed-point value of e raised to the xth power.
Definition qfp16.c:425
qFP16_t qFP16_Floor(const qFP16_t x)
Returns the largest integer value less than or equal to x.
Definition qfp16.c:200
qFP16_t qFP16_Round(const qFP16_t x)
Returns the nearest integer value of the fixed-point argument x.
Definition qfp16.c:214
qFP16_t qFP16_Cos(qFP16_t x)
Computes the fixed-point cosine of the radian angle x.
Definition qfp16.c:592
int qFP16_SettingsSet(qFP16_Settings_t *const instance, qFP16_t min, qFP16_t max, uint8_t rounding, uint8_t saturate)
Set settings for the fixed-point API.
Definition qfp16.c:88
qFP16_t qFP16_Ceil(const qFP16_t x)
Returns the smallest integer value greater than or equal to x.
Definition qfp16.c:206
qFP16_t qFP16_Div(const qFP16_t x, const qFP16_t y)
Returns the fixed-point division operation x / y.
Definition qfp16.c:298
int qFP16_FPToInt(const qFP16_t x)
Returns the fixed-point value x converted to int.
Definition qfp16.c:120
qFP16_t qFP16_Sinh(qFP16_t x)
Computes the fixed-point hyperbolic sine of x.
Definition qfp16.c:683
qFP16_t qFP16_DoubleToFP(const double x)
Returns the double value x converted to fixed-point q16.16.
Definition qfp16.c:166
qFP16_t qFP16_Abs(const qFP16_t x)
Returns the absolute value of x.
Definition qfp16.c:186
qFP16_t qFP16_AToFP(const char *s)
Parses the C string s, interpreting its content as a fixed-point (q16.16) number and returns its valu...
Definition qfp16.c:860
qFP16_t qFP16_Atan(qFP16_t x)
Computes the fixed-point arc tangent of x in radians.
Definition qfp16.c:636
qFP16_t qFP16_Add(const qFP16_t X, const qFP16_t Y)
Returns the fixed-point addition x + y.
Definition qfp16.c:219
qFP16_t qFP16_Tan(qFP16_t x)
Computes the fixed-point tangent of the radian angle x.
Definition qfp16.c:597
qFP16_t qFP16_IPow(const qFP16_t x, const qFP16_t y)
Returns x raised to the power of the integer part of y. (x^y)
Definition qfp16.c:755
qFP16_t qFP16_RadToDeg(const qFP16_t x)
Converts angle units from radians to degrees.
Definition qfp16.c:533
qFP16_t qFP16_Log(qFP16_t x)
Returns the fixed-point natural logarithm (base-e logarithm) of x.
Definition qfp16.c:469
qFP16_t qFP16_FloatToFP(const float x)
Returns the float value x converted to fixed-point q16.16.
Definition qfp16.c:146
qFP16_t qFP16_IntToFP(const int x)
Returns the int value x converted to fixed-point q16.16.
Definition qfp16.c:141
void qFP16_SettingsSelect(qFP16_Settings_t *const instance)
Select the provided setting instance to perform fixed-point operations.
Definition qfp16.c:110
const struct _qFP16_const_s qFP16
Fixed-point Q16.16 constants.
qFP16_t qFP16_Acos(qFP16_t x)
Computes the fixed-point arc cosine of x in radians.
Definition qfp16.c:654
qFP16_t qFP16_WrapToPi(qFP16_t x)
Wrap the fixed-point angle in radians to [−pi pi].
Definition qfp16.c:543
qFP16_t qFP16_Sin(qFP16_t x)
Computes the fixed-point sine of the radian angle x.
Definition qfp16.c:571
qFP16_t qFP16_Pow(const qFP16_t x, const qFP16_t y)
Returns x raised to the power of y. (x^y)
Definition qfp16.c:783
double qFP16_FPToDouble(const qFP16_t x)
Returns the fixed-point value x converted to double.
Definition qfp16.c:179
qFP16_t qFP16_Cosh(qFP16_t x)
Computes the fixed-point hyperbolic cosine of x.
Definition qfp16.c:659
qFP16_t qFP16_Sub(const qFP16_t X, const qFP16_t Y)
Returns the fixed-point subtraction x - y.
Definition qfp16.c:233
qFP16_t qFP16_Asin(qFP16_t x)
Computes the fixed-point arc sine of x in radians.
Definition qfp16.c:641
qFP16_t qFP16_WrapTo180(qFP16_t x)
Wrap the fixed-point angle in degrees to [−180 180].
Definition qfp16.c:557
qFP16_t qFP16_Log2(const qFP16_t x)
Returns the fixed-point log base 2 of x.
Definition qfp16.c:505
qFP16_t qFP16_DegToRad(const qFP16_t x)
Converts angle units from degrees to radians.
Definition qfp16.c:538
qFP16_t qFP16_Tanh(qFP16_t x)
Computes the fixed-point hyperbolic tangent of x.
Definition qfp16.c:710
qFP16_t qFP16_Mul(const qFP16_t x, const qFP16_t y)
Returns the fixed-point product operation x * y.
Definition qfp16.c:247
float qFP16_FPToFloat(const qFP16_t x)
Returns the fixed-point value x converted to float.
Definition qfp16.c:159
A Q16.16 fixed-point settings object.
Definition qfp16.h:79