IQMathLibrary  1.0
Macros | Functions
IQmathLib.h File Reference

Detailed Description

Library of IQMath operations.



#include <limits.h>
#include <stdlib.h>
#include <stdint.h>
Include dependency graph for IQmathLib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GLOBAL_IQ   24
 The IQ format to be used when the IQ format is not explicitly specified (such as _IQcos instead of _IQ16cos). This value must be between 1 and 30, inclusive.
 
#define _IQmpy2(A)   ((A) << 1)
 Multiplies an IQ value by 2. More...
 
#define _IQmpy4(A)   ((A) << 2)
 Multiplies an IQ value by 4. More...
 
#define _IQmpy8(A)   ((A) << 3)
 Multiplies an IQ value by 8. More...
 
#define _IQmpy16(A)   ((A) << 4)
 Multiplies an IQ value by 16. More...
 
#define _IQmpy32(A)   ((A) << 5)
 Multiplies an IQ value by 32. More...
 
#define _IQmpy64(A)   ((A) << 6)
 Multiplies an IQ value by 64. More...
 
#define _IQdiv2(A)   ((A) >> 1)
 Divides an IQ value by 2. More...
 
#define _IQdiv4(A)   ((A) >> 2)
 Divides an IQ value by 4. More...
 
#define _IQdiv8(A)   ((A) >> 3)
 Divides an IQ value by 8. More...
 
#define _IQdiv16(A)   ((A) >> 4)
 Divides an IQ value by 16. More...
 
#define _IQdiv32(A)   ((A) >> 5)
 Divides an IQ value by 32. More...
 
#define _IQdiv64(A)   ((A) >> 6)
 Divides an IQ value by 64. More...
 
#define _IQ30(A)   ((_iq30)((A) * ((_iq30)1 << 30)))
 Converts a value into an IQ30 number. More...
 
#define _IQ29(A)   ((_iq29)((A) * ((_iq29)1 << 29)))
 Converts a value into an IQ29 number. More...
 
#define _IQ28(A)   ((_iq28)((A) * ((_iq28)1 << 28)))
 Converts a value into an IQ28 number. More...
 
#define _IQ27(A)   ((_iq27)((A) * ((_iq27)1 << 27)))
 Converts a value into an IQ27 number. More...
 
#define _IQ26(A)   ((_iq26)((A) * ((_iq26)1 << 26)))
 Converts a value into an IQ26 number. More...
 
#define _IQ25(A)   ((_iq25)((A) * ((_iq25)1 << 25)))
 Converts a value into an IQ25 number. More...
 
#define _IQ24(A)   ((_iq24)((A) * ((_iq24)1 << 24)))
 Converts a value into an IQ24 number. More...
 
#define _IQ23(A)   ((_iq23)((A) * ((_iq23)1 << 23)))
 Converts a value into an IQ23 number. More...
 
#define _IQ22(A)   ((_iq22)((A) * ((_iq22)1 << 22)))
 Converts a value into an IQ22 number. More...
 
#define _IQ21(A)   ((_iq21)((A) * ((_iq21)1 << 21)))
 Converts a value into an IQ21 number. More...
 
#define _IQ20(A)   ((_iq20)((A) * ((_iq20)1 << 20)))
 Converts a value into an IQ20 number. More...
 
#define _IQ19(A)   ((_iq19)((A) * ((_iq19)1 << 19)))
 Converts a value into an IQ19 number. More...
 
#define _IQ18(A)   ((_iq18)((A) * ((_iq18)1 << 18)))
 Converts a value into an IQ18 number. More...
 
#define _IQ17(A)   ((_iq17)((A) * ((_iq17)1 << 17)))
 Converts a value into an IQ17 number. More...
 
#define _IQ16(A)   ((_iq16)((A) * ((_iq16)1 << 16)))
 Converts a value into an IQ16 number. More...
 
#define _IQ15(A)   ((_iq15)((A) * ((_iq15)1 << 15)))
 Converts a value into an IQ15 number. More...
 
#define _IQ14(A)   ((_iq14)((A) * ((_iq14)1 << 14)))
 Converts a value into an IQ14 number. More...
 
#define _IQ13(A)   ((_iq13)((A) * ((_iq13)1 << 13)))
 Converts a value into an IQ13 number. More...
 
#define _IQ12(A)   ((_iq12)((A) * ((_iq12)1 << 12)))
 Converts a value into an IQ12 number. More...
 
#define _IQ11(A)   ((_iq11)((A) * ((_iq11)1 << 11)))
 Converts a value into an IQ11 number. More...
 
#define _IQ10(A)   ((_iq10)((A) * ((_iq10)1 << 10)))
 Converts a value into an IQ10 number. More...
 
#define _IQ9(A)   ((_iq9)((A) * ((_iq9)1 << 9)))
 Converts a value into an IQ9 number. More...
 
#define _IQ8(A)   ((_iq8)((A) * ((_iq8)1 << 8)))
 Converts a value into an IQ8 number. More...
 
#define _IQ7(A)   ((_iq7)((A) * ((_iq7)1 << 7)))
 Converts a value into an IQ7 number. More...
 
#define _IQ6(A)   ((_iq6)((A) * ((_iq6)1 << 6)))
 Converts a value into an IQ6 number. More...
 
#define _IQ5(A)   ((_iq5)((A) * ((_iq5)1 << 5)))
 Converts a value into an IQ5 number. More...
 
#define _IQ4(A)   ((_iq4)((A) * ((_iq4)1 << 4)))
 Converts a value into an IQ4 number. More...
 
#define _IQ3(A)   ((_iq3)((A) * ((_iq3)1 << 3)))
 Converts a value into an IQ3 number. More...
 
#define _IQ2(A)   ((_iq2)((A) * ((_iq2)1 << 2)))
 Converts a value into an IQ2 number. More...
 
#define _IQ1(A)   ((_iq1)((A) * ((_iq1)1 << 1)))
 Converts a value into an IQ1 number. More...
 
#define _IQ(A)   _IQ24(A)
 Converts a value into an the global IQ format. More...
 
#define _IQtoF(A)   _IQ24toF(A)
 Convert a global IQ format number to a floating point value. More...
 
#define _IQsat(A, Pos, Neg)
 Saturates an IQ number in a given range. More...
 
#define _IQmpy(A, B)   _IQ24mpy(A, B)
 Multiplies two global IQ format numbers. More...
 
#define _IQrmpy(A, B)   _IQ24rmpy(A, B)
 Multiplies two global IQ format numbers, with rounding. More...
 
#define _IQrsmpy(A, B)   _IQ24rsmpy(A, B)
 Multiplies two global IQ format numbers, with rounding and saturation. More...
 
#define _IQdiv(A, B)   _IQ24div(A, B)
 Divides two global IQ format numbers. More...
 
#define _IQsin(A)   _IQ24sin(A)
 Computes the sine of a global IQ format input, in radians. More...
 
#define _IQsinPU(A)   _IQ24sinPU(A)
 Computes the sine of a global IQ format input. More...
 
#define _IQasin(A)   _IQ24asin(A)
 Computes the inverse sine of a global IQ format input. More...
 
#define _IQcos(A)   _IQ24cos(A)
 Computes the cosine of a global IQ format input, in radians. More...
 
#define _IQcosPU(A)   _IQ24cosPU(A)
 Computes the cossine of a global IQ format input. More...
 
#define _IQ29acos(A)   (_IQ29(1.570796327) - _IQ29asin(A))
 Computes the inverse cosine of an IQ29 type input. More...
 
#define _IQ28acos(A)   (_IQ28(1.570796327) - _IQ28asin(A))
 Computes the inverse cosine of an IQ28 type input. More...
 
#define _IQ27acos(A)   (_IQ27(1.570796327) - _IQ27asin(A))
 Computes the inverse cosine of an IQ27 type input. More...
 
#define _IQ26acos(A)   (_IQ26(1.570796327) - _IQ26asin(A))
 Computes the inverse cosine of an IQ26 type input. More...
 
#define _IQ25acos(A)   (_IQ25(1.570796327) - _IQ25asin(A))
 Computes the inverse cosine of an IQ25 type input. More...
 
#define _IQ24acos(A)   (_IQ24(1.570796327) - _IQ24asin(A))
 Computes the inverse cosine of an IQ24 type input. More...
 
#define _IQ23acos(A)   (_IQ23(1.570796327) - _IQ23asin(A))
 Computes the inverse cosine of an IQ23 type input. More...
 
#define _IQ22acos(A)   (_IQ22(1.570796327) - _IQ22asin(A))
 Computes the inverse cosine of an IQ22 type input. More...
 
#define _IQ21acos(A)   (_IQ21(1.570796327) - _IQ21asin(A))
 Computes the inverse cosine of an IQ21 type input. More...
 
#define _IQ20acos(A)   (_IQ20(1.570796327) - _IQ20asin(A))
 Computes the inverse cosine of an IQ20 type input. More...
 
#define _IQ19acos(A)   (_IQ19(1.570796327) - _IQ19asin(A))
 Computes the inverse cosine of an IQ19 type input. More...
 
#define _IQ18acos(A)   (_IQ18(1.570796327) - _IQ18asin(A))
 Computes the inverse cosine of an IQ18 type input. More...
 
#define _IQ17acos(A)   (_IQ17(1.570796327) - _IQ17asin(A))
 Computes the inverse cosine of an IQ17 type input. More...
 
#define _IQ16acos(A)   (_IQ16(1.570796327) - _IQ16asin(A))
 Computes the inverse cosine of an IQ16 type input. More...
 
#define _IQ15acos(A)   (_IQ15(1.570796327) - _IQ15asin(A))
 Computes the inverse cosine of an IQ15 type input. More...
 
#define _IQ14acos(A)   (_IQ14(1.570796327) - _IQ14asin(A))
 Computes the inverse cosine of an IQ14 type input. More...
 
#define _IQ13acos(A)   (_IQ13(1.570796327) - _IQ13asin(A))
 Computes the inverse cosine of an IQ13 type input. More...
 
#define _IQ12acos(A)   (_IQ12(1.570796327) - _IQ12asin(A))
 Computes the inverse cosine of an IQ12 type input. More...
 
#define _IQ11acos(A)   (_IQ11(1.570796327) - _IQ11asin(A))
 Computes the inverse cosine of an IQ11 type input. More...
 
#define _IQ10acos(A)   (_IQ10(1.570796327) - _IQ10asin(A))
 Computes the inverse cosine of an IQ10 type input. More...
 
#define _IQ9acos(A)   (_IQ9(1.570796327) - _IQ9asin(A))
 Computes the inverse cosine of an IQ9 type input. More...
 
#define _IQ8acos(A)   (_IQ8(1.570796327) - _IQ8asin(A))
 Computes the inverse cosine of an IQ8 type input. More...
 
#define _IQ7acos(A)   (_IQ7(1.570796327) - _IQ7asin(A))
 Computes the inverse cosine of an IQ7 type input. More...
 
#define _IQ6acos(A)   (_IQ6(1.570796327) - _IQ6asin(A))
 Computes the inverse cosine of an IQ6 type input. More...
 
#define _IQ5acos(A)   (_IQ5(1.570796327) - _IQ5asin(A))
 Computes the inverse cosine of an IQ5 type input. More...
 
#define _IQ4acos(A)   (_IQ4(1.570796327) - _IQ4asin(A))
 Computes the inverse cosine of an IQ4 type input. More...
 
#define _IQ3acos(A)   (_IQ3(1.570796327) - _IQ3asin(A))
 Computes the inverse cosine of an IQ3 type input. More...
 
#define _IQ2acos(A)   (_IQ2(1.570796327) - _IQ2asin(A))
 Computes the inverse cosine of an IQ2 type input. More...
 
#define _IQ1acos(A)   (_IQ1(1.570796327) - _IQ1asin(A))
 Computes the inverse cosine of an IQ1 type input. More...
 
#define _IQacos(A)   _IQ24acos(A)
 Computes the inverse cosine of a global IQ format input. More...
 
#define _IQatan2(A, B)   _IQ24atan2(A, B)
 Compute the 4-quadrant arctangent of a global IQ format input, in radians. More...
 
#define _IQatan2PU(A, B)   _IQ24atan2PU(A, B)
 Compute the 4-quadrant arctangent of a global IQ format input. More...
 
#define _IQ29atan(A)   _IQ29atan2(A, _IQ29(1.0))
 Computes the inverse tangnet of an IQ29 format input. More...
 
#define _IQ28atan(A)   _IQ28atan2(A, _IQ28(1.0))
 Computes the inverse tangnet of an IQ28 format input. More...
 
#define _IQ27atan(A)   _IQ27atan2(A, _IQ27(1.0))
 Computes the inverse tangnet of an IQ27 format input. More...
 
#define _IQ26atan(A)   _IQ26atan2(A, _IQ26(1.0))
 Computes the inverse tangnet of an IQ26 format input. More...
 
#define _IQ25atan(A)   _IQ25atan2(A, _IQ25(1.0))
 Computes the inverse tangnet of an IQ25 format input. More...
 
#define _IQ24atan(A)   _IQ24atan2(A, _IQ24(1.0))
 Computes the inverse tangnet of an IQ24 format input. More...
 
#define _IQ23atan(A)   _IQ23atan2(A, _IQ23(1.0))
 Computes the inverse tangnet of an IQ23 format input. More...
 
#define _IQ22atan(A)   _IQ22atan2(A, _IQ22(1.0))
 Computes the inverse tangnet of an IQ22 format input. More...
 
#define _IQ21atan(A)   _IQ21atan2(A, _IQ21(1.0))
 Computes the inverse tangnet of an IQ21 format input. More...
 
#define _IQ20atan(A)   _IQ20atan2(A, _IQ20(1.0))
 Computes the inverse tangnet of an IQ20 format input. More...
 
#define _IQ19atan(A)   _IQ19atan2(A, _IQ19(1.0))
 Computes the inverse tangnet of an IQ19 format input. More...
 
#define _IQ18atan(A)   _IQ18atan2(A, _IQ18(1.0))
 Computes the inverse tangnet of an IQ18 format input. More...
 
#define _IQ17atan(A)   _IQ17atan2(A, _IQ17(1.0))
 Computes the inverse tangnet of an IQ17 format input. More...
 
#define _IQ16atan(A)   _IQ16atan2(A, _IQ16(1.0))
 Computes the inverse tangnet of an IQ16 format input. More...
 
#define _IQ15atan(A)   _IQ15atan2(A, _IQ15(1.0))
 Computes the inverse tangnet of an IQ15 format input. More...
 
#define _IQ14atan(A)   _IQ14atan2(A, _IQ14(1.0))
 Computes the inverse tangnet of an IQ14 format input. More...
 
#define _IQ13atan(A)   _IQ13atan2(A, _IQ13(1.0))
 Computes the inverse tangnet of an IQ13 format input. More...
 
#define _IQ12atan(A)   _IQ12atan2(A, _IQ12(1.0))
 Computes the inverse tangnet of an IQ12 format input. More...
 
#define _IQ11atan(A)   _IQ11atan2(A, _IQ11(1.0))
 Computes the inverse tangnet of an IQ11 format input. More...
 
#define _IQ10atan(A)   _IQ10atan2(A, _IQ10(1.0))
 Computes the inverse tangnet of an IQ10 format input. More...
 
#define _IQ9atan(A)   _IQ9atan2(A, _IQ9(1.0))
 Computes the inverse tangnet of an IQ9 format input. More...
 
#define _IQ8atan(A)   _IQ8atan2(A, _IQ8(1.0))
 Computes the inverse tangnet of an IQ8 format input. More...
 
#define _IQ7atan(A)   _IQ7atan2(A, _IQ7(1.0))
 Computes the inverse tangnet of an IQ7 format input. More...
 
#define _IQ6atan(A)   _IQ6atan2(A, _IQ6(1.0))
 Computes the inverse tangnet of an IQ6 format input. More...
 
#define _IQ5atan(A)   _IQ5atan2(A, _IQ5(1.0))
 Computes the inverse tangnet of an IQ5 format input. More...
 
#define _IQ4atan(A)   _IQ4atan2(A, _IQ4(1.0))
 Computes the inverse tangnet of an IQ4 format input. More...
 
#define _IQ3atan(A)   _IQ3atan2(A, _IQ3(1.0))
 Computes the inverse tangnet of an IQ3 format input. More...
 
#define _IQ2atan(A)   _IQ2atan2(A, _IQ2(1.0))
 Computes the inverse tangnet of an IQ2 format input. More...
 
#define _IQ1atan(A)   _IQ1atan2(A, _IQ1(1.0))
 Computes the inverse tangnet of an IQ1 format input. More...
 
#define _IQatan(A)   _IQ24atan2(A, _IQ24(1.0))
 Computes the inverse tangent of a global IQ format input. More...
 
#define _IQsqrt(A)   _IQ24sqrt(A)
 Calculate square root of a global IQ format input. More...
 
#define _IQisqrt(A)   _IQ24isqrt(A)
 Computes 1 over the square root of a global IQ format number. More...
 
#define _IQexp(A)   _IQ24exp(A)
 Computes the exponential of a global IQ format input. More...
 
#define _IQlog(A)   _IQ24log(A)
 Computes the base-e logarithm of a global IQ format input. More...
 
#define _IQ30int(A)   ((A) >> 30)
 Returns the integer portion of an IQ30 type number. More...
 
#define _IQ29int(A)   ((A) >> 29)
 Returns the integer portion of an IQ29 type number. More...
 
#define _IQ28int(A)   ((A) >> 28)
 Returns the integer portion of an IQ28 type number. More...
 
#define _IQ27int(A)   ((A) >> 27)
 Returns the integer portion of an IQ27 type number. More...
 
#define _IQ26int(A)   ((A) >> 26)
 Returns the integer portion of an IQ26 type number. More...
 
#define _IQ25int(A)   ((A) >> 25)
 Returns the integer portion of an IQ25 type number. More...
 
#define _IQ24int(A)   ((A) >> 24)
 Returns the integer portion of an IQ24 type number. More...
 
#define _IQ23int(A)   ((A) >> 23)
 Returns the integer portion of an IQ23 type number. More...
 
#define _IQ22int(A)   ((A) >> 22)
 Returns the integer portion of an IQ22 type number. More...
 
#define _IQ21int(A)   ((A) >> 21)
 Returns the integer portion of an IQ21 type number. More...
 
#define _IQ20int(A)   ((A) >> 20)
 Returns the integer portion of an IQ20 type number. More...
 
#define _IQ19int(A)   ((A) >> 19)
 Returns the integer portion of an IQ19 type number. More...
 
#define _IQ18int(A)   ((A) >> 18)
 Returns the integer portion of an IQ18 type number. More...
 
#define _IQ17int(A)   ((A) >> 17)
 Returns the integer portion of an IQ17 type number. More...
 
#define _IQ16int(A)   ((A) >> 16)
 Returns the integer portion of an IQ16 type number. More...
 
#define _IQ15int(A)   ((A) >> 15)
 Returns the integer portion of an IQ15 type number. More...
 
#define _IQ14int(A)   ((A) >> 14)
 Returns the integer portion of an IQ14 type number. More...
 
#define _IQ13int(A)   ((A) >> 13)
 Returns the integer portion of an IQ13 type number. More...
 
#define _IQ12int(A)   ((A) >> 12)
 Returns the integer portion of an IQ12 type number. More...
 
#define _IQ11int(A)   ((A) >> 11)
 Returns the integer portion of an IQ11 type number. More...
 
#define _IQ10int(A)   ((A) >> 10)
 Returns the integer portion of an IQ10 type number. More...
 
#define _IQ9int(A)   ((A) >> 9)
 Returns the integer portion of an IQ9 type number. More...
 
#define _IQ8int(A)   ((A) >> 8)
 Returns the integer portion of an IQ8 type number. More...
 
#define _IQ7int(A)   ((A) >> 7)
 Returns the integer portion of an IQ7 type number. More...
 
#define _IQ6int(A)   ((A) >> 6)
 Returns the integer portion of an IQ6 type number. More...
 
#define _IQ5int(A)   ((A) >> 5)
 Returns the integer portion of an IQ5 type number. More...
 
#define _IQ4int(A)   ((A) >> 4)
 Returns the integer portion of an IQ4 type number. More...
 
#define _IQ3int(A)   ((A) >> 3)
 Returns the integer portion of an IQ3 type number. More...
 
#define _IQ2int(A)   ((A) >> 2)
 Returns the integer portion of an IQ2 type number. More...
 
#define _IQ1int(A)   ((A) >> 1)
 Returns the integer portion of an IQ1 type number. More...
 
#define _IQint(A)   ((A) >> GLOBAL_IQ)
 Returns the integer portion of a global IQ format number. More...
 
#define _IQfrac(A)   _IQ24frac(A)
 Computes the fractional portion a global IQ format number. More...
 
#define _IQmpyIQX(A, n1, B, n2)   _IQ24mpyIQX(A, n1, B, n2)
 Multiply two IQ numbers in different IQ formats, returning the product in global IQ format. More...
 
#define _IQ30mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ30 numbers. More...
 
#define _IQ29mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ29 numbers. More...
 
#define _IQ28mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ28 numbers. More...
 
#define _IQ27mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ27 numbers. More...
 
#define _IQ26mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ26 numbers. More...
 
#define _IQ25mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ25 numbers. More...
 
#define _IQ24mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ24 numbers. More...
 
#define _IQ23mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ23 numbers. More...
 
#define _IQ22mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ22 numbers. More...
 
#define _IQ21mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ21 numbers. More...
 
#define _IQ20mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ20 numbers. More...
 
#define _IQ19mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ19 numbers. More...
 
#define _IQ18mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ18 numbers. More...
 
#define _IQ17mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ17 numbers. More...
 
#define _IQ16mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ16 numbers. More...
 
#define _IQ15mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ15 numbers. More...
 
#define _IQ14mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ14 numbers. More...
 
#define _IQ13mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ13 numbers. More...
 
#define _IQ12mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ12 numbers. More...
 
#define _IQ11mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ11 numbers. More...
 
#define _IQ10mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ10 numbers. More...
 
#define _IQ9mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ9 numbers. More...
 
#define _IQ8mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ8 numbers. More...
 
#define _IQ7mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ7 numbers. More...
 
#define _IQ6mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ6 numbers. More...
 
#define _IQ5mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ5 numbers. More...
 
#define _IQ4mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ4 numbers. More...
 
#define _IQ3mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ3 numbers. More...
 
#define _IQ2mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ2 numbers. More...
 
#define _IQ1mag(A, B)   _IQmag(A, B)
 Computes the square root of A^2 + B^2 using IQ1 numbers. More...
 
#define _IQimag(A, B)   _IQ24imag(A, B)
 Computes the inverse square root of A^2 + B^2 using IQ1 numbers. More...
 
#define _atoIQ(A)   _atoIQ24(A)
 Converts a string into a global IQ format number. More...
 
#define _IQtoa(A, B, C)   _IQ24toa(A, B, C)
 Converts a global IQ format input into a string. More...
 
#define _IQ30abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ30 number. More...
 
#define _IQ29abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ29 number. More...
 
#define _IQ28abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ28 number. More...
 
#define _IQ27abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ27 number. More...
 
#define _IQ26abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ26 number. More...
 
#define _IQ25abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ25 number. More...
 
#define _IQ24abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ24 number. More...
 
#define _IQ23abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ23 number. More...
 
#define _IQ22abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ22 number. More...
 
#define _IQ21abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ21 number. More...
 
#define _IQ20abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ20 number. More...
 
#define _IQ19abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ19 number. More...
 
#define _IQ18abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ18 number. More...
 
#define _IQ17abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ17 number. More...
 
#define _IQ16abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ16 number. More...
 
#define _IQ15abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ15 number. More...
 
#define _IQ14abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ14 number. More...
 
#define _IQ13abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ13 number. More...
 
#define _IQ12abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ12 number. More...
 
#define _IQ11abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ11 number. More...
 
#define _IQ10abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ10 number. More...
 
#define _IQ9abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ9 number. More...
 
#define _IQ8abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ8 number. More...
 
#define _IQ7abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ7 number. More...
 
#define _IQ6abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ6 number. More...
 
#define _IQ5abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ5 number. More...
 
#define _IQ4abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ4 number. More...
 
#define _IQ3abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ3 number. More...
 
#define _IQ2abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ2 number. More...
 
#define _IQ1abs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an IQ1 number. More...
 
#define _IQabs(A)   (((A) < 0) ? - (A) : (A))
 Computes the absolute value of an global IQ format number. More...
 

Functions

int32_t _IQmag (int32_t A, int32_t B)
 Calculate the magnitude of two IQ31 inputs. More...
 

Macro Definition Documentation

§ _IQmpy2

#define _IQmpy2 (   A)    ((A) << 1)

Multiplies an IQ value by 2.

Parameters
AIQ type input.
Returns
IQ type result of multiplication.

§ _IQmpy4

#define _IQmpy4 (   A)    ((A) << 2)

Multiplies an IQ value by 4.

Parameters
AIQ type input.
Returns
IQ type result of multiplication.

§ _IQmpy8

#define _IQmpy8 (   A)    ((A) << 3)

Multiplies an IQ value by 8.

Parameters
AIQ type input.
Returns
IQ type result of multiplication.

§ _IQmpy16

#define _IQmpy16 (   A)    ((A) << 4)

Multiplies an IQ value by 16.

Parameters
AIQ type input.
Returns
IQ type result of multiplication.

§ _IQmpy32

#define _IQmpy32 (   A)    ((A) << 5)

Multiplies an IQ value by 32.

Parameters
AIQ type input.
Returns
IQ type result of multiplication.

§ _IQmpy64

#define _IQmpy64 (   A)    ((A) << 6)

Multiplies an IQ value by 64.

Parameters
AIQ type input.
Returns
IQ type result of multiplication.

§ _IQdiv2

#define _IQdiv2 (   A)    ((A) >> 1)

Divides an IQ value by 2.

Parameters
AIQ type input.
Returns
IQ type result of division.

§ _IQdiv4

#define _IQdiv4 (   A)    ((A) >> 2)

Divides an IQ value by 4.

Parameters
AIQ type input.
Returns
IQ type result of division.

§ _IQdiv8

#define _IQdiv8 (   A)    ((A) >> 3)

Divides an IQ value by 8.

Parameters
AIQ type input.
Returns
IQ type result of division.

§ _IQdiv16

#define _IQdiv16 (   A)    ((A) >> 4)

Divides an IQ value by 16.

Parameters
AIQ type input.
Returns
IQ type result of division.

§ _IQdiv32

#define _IQdiv32 (   A)    ((A) >> 5)

Divides an IQ value by 32.

Parameters
AIQ type input.
Returns
IQ type result of division.

§ _IQdiv64

#define _IQdiv64 (   A)    ((A) >> 6)

Divides an IQ value by 64.

Parameters
AIQ type input.
Returns
IQ type result of division.

§ _IQ30

#define _IQ30 (   A)    ((_iq30)((A) * ((_iq30)1 << 30)))

Converts a value into an IQ30 number.

Parameters
ANumber input.
Returns
IQ30 type result.

§ _IQ29

#define _IQ29 (   A)    ((_iq29)((A) * ((_iq29)1 << 29)))

Converts a value into an IQ29 number.

Parameters
ANumber input.
Returns
IQ29 type result.

§ _IQ28

#define _IQ28 (   A)    ((_iq28)((A) * ((_iq28)1 << 28)))

Converts a value into an IQ28 number.

Parameters
ANumber input.
Returns
IQ28 type result.

§ _IQ27

#define _IQ27 (   A)    ((_iq27)((A) * ((_iq27)1 << 27)))

Converts a value into an IQ27 number.

Parameters
ANumber input.
Returns
IQ27 type result.

§ _IQ26

#define _IQ26 (   A)    ((_iq26)((A) * ((_iq26)1 << 26)))

Converts a value into an IQ26 number.

Parameters
ANumber input.
Returns
IQ26 type result.

§ _IQ25

#define _IQ25 (   A)    ((_iq25)((A) * ((_iq25)1 << 25)))

Converts a value into an IQ25 number.

Parameters
ANumber input.
Returns
IQ25 type result.

§ _IQ24

#define _IQ24 (   A)    ((_iq24)((A) * ((_iq24)1 << 24)))

Converts a value into an IQ24 number.

Parameters
ANumber input.
Returns
IQ24 type result.

§ _IQ23

#define _IQ23 (   A)    ((_iq23)((A) * ((_iq23)1 << 23)))

Converts a value into an IQ23 number.

Parameters
ANumber input.
Returns
IQ23 type result.

§ _IQ22

#define _IQ22 (   A)    ((_iq22)((A) * ((_iq22)1 << 22)))

Converts a value into an IQ22 number.

Parameters
ANumber input.
Returns
IQ22 type result.

§ _IQ21

#define _IQ21 (   A)    ((_iq21)((A) * ((_iq21)1 << 21)))

Converts a value into an IQ21 number.

Parameters
ANumber input.
Returns
IQ21 type result.

§ _IQ20

#define _IQ20 (   A)    ((_iq20)((A) * ((_iq20)1 << 20)))

Converts a value into an IQ20 number.

Parameters
ANumber input.
Returns
IQ20 type result.

§ _IQ19

#define _IQ19 (   A)    ((_iq19)((A) * ((_iq19)1 << 19)))

Converts a value into an IQ19 number.

Parameters
ANumber input.
Returns
IQ19 type result.

§ _IQ18

#define _IQ18 (   A)    ((_iq18)((A) * ((_iq18)1 << 18)))

Converts a value into an IQ18 number.

Parameters
ANumber input.
Returns
IQ18 type result.

§ _IQ17

#define _IQ17 (   A)    ((_iq17)((A) * ((_iq17)1 << 17)))

Converts a value into an IQ17 number.

Parameters
ANumber input.
Returns
IQ17 type result.

§ _IQ16

#define _IQ16 (   A)    ((_iq16)((A) * ((_iq16)1 << 16)))

Converts a value into an IQ16 number.

Parameters
ANumber input.
Returns
IQ16 type result.

§ _IQ15

#define _IQ15 (   A)    ((_iq15)((A) * ((_iq15)1 << 15)))

Converts a value into an IQ15 number.

Parameters
ANumber input.
Returns
IQ15 type result.

§ _IQ14

#define _IQ14 (   A)    ((_iq14)((A) * ((_iq14)1 << 14)))

Converts a value into an IQ14 number.

Parameters
ANumber input.
Returns
IQ14 type result.

§ _IQ13

#define _IQ13 (   A)    ((_iq13)((A) * ((_iq13)1 << 13)))

Converts a value into an IQ13 number.

Parameters
ANumber input.
Returns
IQ13 type result.

§ _IQ12

#define _IQ12 (   A)    ((_iq12)((A) * ((_iq12)1 << 12)))

Converts a value into an IQ12 number.

Parameters
ANumber input.
Returns
IQ12 type result.

§ _IQ11

#define _IQ11 (   A)    ((_iq11)((A) * ((_iq11)1 << 11)))

Converts a value into an IQ11 number.

Parameters
ANumber input.
Returns
IQ11 type result.

§ _IQ10

#define _IQ10 (   A)    ((_iq10)((A) * ((_iq10)1 << 10)))

Converts a value into an IQ10 number.

Parameters
ANumber input.
Returns
IQ10 type result.

§ _IQ9

#define _IQ9 (   A)    ((_iq9)((A) * ((_iq9)1 << 9)))

Converts a value into an IQ9 number.

Parameters
ANumber input.
Returns
IQ9 type result.

§ _IQ8

#define _IQ8 (   A)    ((_iq8)((A) * ((_iq8)1 << 8)))

Converts a value into an IQ8 number.

Parameters
ANumber input.
Returns
IQ8 type result.

§ _IQ7

#define _IQ7 (   A)    ((_iq7)((A) * ((_iq7)1 << 7)))

Converts a value into an IQ7 number.

Parameters
ANumber input.
Returns
IQ7 type result.

§ _IQ6

#define _IQ6 (   A)    ((_iq6)((A) * ((_iq6)1 << 6)))

Converts a value into an IQ6 number.

Parameters
ANumber input.
Returns
IQ6 type result.

§ _IQ5

#define _IQ5 (   A)    ((_iq5)((A) * ((_iq5)1 << 5)))

Converts a value into an IQ5 number.

Parameters
ANumber input.
Returns
IQ5 type result.

§ _IQ4

#define _IQ4 (   A)    ((_iq4)((A) * ((_iq4)1 << 4)))

Converts a value into an IQ4 number.

Parameters
ANumber input.
Returns
IQ4 type result.

§ _IQ3

#define _IQ3 (   A)    ((_iq3)((A) * ((_iq3)1 << 3)))

Converts a value into an IQ3 number.

Parameters
ANumber input.
Returns
IQ3 type result.

§ _IQ2

#define _IQ2 (   A)    ((_iq2)((A) * ((_iq2)1 << 2)))

Converts a value into an IQ2 number.

Parameters
ANumber input.
Returns
IQ2 type result.

§ _IQ1

#define _IQ1 (   A)    ((_iq1)((A) * ((_iq1)1 << 1)))

Converts a value into an IQ1 number.

Parameters
ANumber input.
Returns
IQ1 type result.

§ _IQ

#define _IQ (   A)    _IQ24(A)

Converts a value into an the global IQ format.

Parameters
ANumber input.
Returns
Global IQ type result.

§ _IQtoF

#define _IQtoF (   A)    _IQ24toF(A)

Convert a global IQ format number to a floating point value.

Parameters
ANumber input.
Returns
Global IQ type result.

§ _IQsat

#define _IQsat (   A,
  Pos,
  Neg 
)
Value:
(((A) > (Pos)) ? \
(Pos) : \
(((A) < (Neg)) ? (Neg) : (A)))

Saturates an IQ number in a given range.

Parameters
AIQ number to be saturated.
PosMaximum positive value.
NegMinimum negative Value.
Returns
Saturated IQ type result.

§ _IQmpy

#define _IQmpy (   A,
 
)    _IQ24mpy(A, B)

Multiplies two global IQ format numbers.

Parameters
AGlobal IQ format number to be multiplied.
BGlobal IQ format number to be multiplied.
Returns
Global IQ type result of multiplication.

§ _IQrmpy

#define _IQrmpy (   A,
 
)    _IQ24rmpy(A, B)

Multiplies two global IQ format numbers, with rounding.

Parameters
AGlobal IQ format number to be multiplied.
BGlobal IQ format number to be multiplied.
Returns
Global IQ type result of multiplication.

§ _IQrsmpy

#define _IQrsmpy (   A,
 
)    _IQ24rsmpy(A, B)

Multiplies two global IQ format numbers, with rounding and saturation.

Parameters
AGlobal IQ format number to be multiplied.
BGlobal IQ format number to be multiplied.
Returns
Global IQ type result of multiplication.

§ _IQdiv

#define _IQdiv (   A,
 
)    _IQ24div(A, B)

Divides two global IQ format numbers.

Parameters
AGlobal IQ format numerator to be divided.
BGlobal IQ format denominator to divide by.
Returns
Global IQ type result of division.

§ _IQsin

#define _IQsin (   A)    _IQ24sin(A)

Computes the sine of a global IQ format input, in radians.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of sine operation.

§ _IQsinPU

#define _IQsinPU (   A)    _IQ24sinPU(A)

Computes the sine of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type per-unit result of sine operation.

§ _IQasin

#define _IQasin (   A)    _IQ24asin(A)

Computes the inverse sine of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of inverse sine operation.

§ _IQcos

#define _IQcos (   A)    _IQ24cos(A)

Computes the cosine of a global IQ format input, in radians.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of cosine operation.

§ _IQcosPU

#define _IQcosPU (   A)    _IQ24cosPU(A)

Computes the cossine of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type per-unit result of cosine operation.

§ _IQ29acos

#define _IQ29acos (   A)    (_IQ29(1.570796327) - _IQ29asin(A))

Computes the inverse cosine of an IQ29 type input.

Parameters
AIQ29 input.
Returns
IQ29 type result of inverse cosine operation.

§ _IQ28acos

#define _IQ28acos (   A)    (_IQ28(1.570796327) - _IQ28asin(A))

Computes the inverse cosine of an IQ28 type input.

Parameters
AIQ28 input.
Returns
IQ28 type result of inverse cosine operation.

§ _IQ27acos

#define _IQ27acos (   A)    (_IQ27(1.570796327) - _IQ27asin(A))

Computes the inverse cosine of an IQ27 type input.

Parameters
AIQ27 input.
Returns
IQ27 type result of inverse cosine operation.

§ _IQ26acos

#define _IQ26acos (   A)    (_IQ26(1.570796327) - _IQ26asin(A))

Computes the inverse cosine of an IQ26 type input.

Parameters
AIQ26 input.
Returns
IQ26 type result of inverse cosine operation.

§ _IQ25acos

#define _IQ25acos (   A)    (_IQ25(1.570796327) - _IQ25asin(A))

Computes the inverse cosine of an IQ25 type input.

Parameters
AIQ25 input.
Returns
IQ25 type result of inverse cosine operation.

§ _IQ24acos

#define _IQ24acos (   A)    (_IQ24(1.570796327) - _IQ24asin(A))

Computes the inverse cosine of an IQ24 type input.

Parameters
AIQ24 input.
Returns
IQ24 type result of inverse cosine operation.

§ _IQ23acos

#define _IQ23acos (   A)    (_IQ23(1.570796327) - _IQ23asin(A))

Computes the inverse cosine of an IQ23 type input.

Parameters
AIQ23 input.
Returns
IQ23 type result of inverse cosine operation.

§ _IQ22acos

#define _IQ22acos (   A)    (_IQ22(1.570796327) - _IQ22asin(A))

Computes the inverse cosine of an IQ22 type input.

Parameters
AIQ22 input.
Returns
IQ22 type result of inverse cosine operation.

§ _IQ21acos

#define _IQ21acos (   A)    (_IQ21(1.570796327) - _IQ21asin(A))

Computes the inverse cosine of an IQ21 type input.

Parameters
AIQ21 input.
Returns
IQ21 type result of inverse cosine operation.

§ _IQ20acos

#define _IQ20acos (   A)    (_IQ20(1.570796327) - _IQ20asin(A))

Computes the inverse cosine of an IQ20 type input.

Parameters
AIQ20 input.
Returns
IQ20 type result of inverse cosine operation.

§ _IQ19acos

#define _IQ19acos (   A)    (_IQ19(1.570796327) - _IQ19asin(A))

Computes the inverse cosine of an IQ19 type input.

Parameters
AIQ19 input.
Returns
IQ19 type result of inverse cosine operation.

§ _IQ18acos

#define _IQ18acos (   A)    (_IQ18(1.570796327) - _IQ18asin(A))

Computes the inverse cosine of an IQ18 type input.

Parameters
AIQ18 input.
Returns
IQ18 type result of inverse cosine operation.

§ _IQ17acos

#define _IQ17acos (   A)    (_IQ17(1.570796327) - _IQ17asin(A))

Computes the inverse cosine of an IQ17 type input.

Parameters
AIQ17 input.
Returns
IQ17 type result of inverse cosine operation.

§ _IQ16acos

#define _IQ16acos (   A)    (_IQ16(1.570796327) - _IQ16asin(A))

Computes the inverse cosine of an IQ16 type input.

Parameters
AIQ16 input.
Returns
IQ16 type result of inverse cosine operation.

§ _IQ15acos

#define _IQ15acos (   A)    (_IQ15(1.570796327) - _IQ15asin(A))

Computes the inverse cosine of an IQ15 type input.

Parameters
AIQ15 input.
Returns
IQ15 type result of inverse cosine operation.

§ _IQ14acos

#define _IQ14acos (   A)    (_IQ14(1.570796327) - _IQ14asin(A))

Computes the inverse cosine of an IQ14 type input.

Parameters
AIQ14 input.
Returns
IQ14 type result of inverse cosine operation.

§ _IQ13acos

#define _IQ13acos (   A)    (_IQ13(1.570796327) - _IQ13asin(A))

Computes the inverse cosine of an IQ13 type input.

Parameters
AIQ13 input.
Returns
IQ13 type result of inverse cosine operation.

§ _IQ12acos

#define _IQ12acos (   A)    (_IQ12(1.570796327) - _IQ12asin(A))

Computes the inverse cosine of an IQ12 type input.

Parameters
AIQ12 input.
Returns
IQ12 type result of inverse cosine operation.

§ _IQ11acos

#define _IQ11acos (   A)    (_IQ11(1.570796327) - _IQ11asin(A))

Computes the inverse cosine of an IQ11 type input.

Parameters
AIQ11 input.
Returns
IQ11 type result of inverse cosine operation.

§ _IQ10acos

#define _IQ10acos (   A)    (_IQ10(1.570796327) - _IQ10asin(A))

Computes the inverse cosine of an IQ10 type input.

Parameters
AIQ10 input.
Returns
IQ10 type result of inverse cosine operation.

§ _IQ9acos

#define _IQ9acos (   A)    (_IQ9(1.570796327) - _IQ9asin(A))

Computes the inverse cosine of an IQ9 type input.

Parameters
AIQ9 input.
Returns
IQ9 type result of inverse cosine operation.

§ _IQ8acos

#define _IQ8acos (   A)    (_IQ8(1.570796327) - _IQ8asin(A))

Computes the inverse cosine of an IQ8 type input.

Parameters
AIQ8 input.
Returns
IQ8 type result of inverse cosine operation.

§ _IQ7acos

#define _IQ7acos (   A)    (_IQ7(1.570796327) - _IQ7asin(A))

Computes the inverse cosine of an IQ7 type input.

Parameters
AIQ7 input.
Returns
IQ7 type result of inverse cosine operation.

§ _IQ6acos

#define _IQ6acos (   A)    (_IQ6(1.570796327) - _IQ6asin(A))

Computes the inverse cosine of an IQ6 type input.

Parameters
AIQ6 input.
Returns
IQ6 type result of inverse cosine operation.

§ _IQ5acos

#define _IQ5acos (   A)    (_IQ5(1.570796327) - _IQ5asin(A))

Computes the inverse cosine of an IQ5 type input.

Parameters
AIQ5 input.
Returns
IQ5 type result of inverse cosine operation.

§ _IQ4acos

#define _IQ4acos (   A)    (_IQ4(1.570796327) - _IQ4asin(A))

Computes the inverse cosine of an IQ4 type input.

Parameters
AIQ4 input.
Returns
IQ4 type result of inverse cosine operation.

§ _IQ3acos

#define _IQ3acos (   A)    (_IQ3(1.570796327) - _IQ3asin(A))

Computes the inverse cosine of an IQ3 type input.

Parameters
AIQ3 input.
Returns
IQ3 type result of inverse cosine operation.

§ _IQ2acos

#define _IQ2acos (   A)    (_IQ2(1.570796327) - _IQ2asin(A))

Computes the inverse cosine of an IQ2 type input.

Parameters
AIQ2 input.
Returns
IQ2 type result of inverse cosine operation.

§ _IQ1acos

#define _IQ1acos (   A)    (_IQ1(1.570796327) - _IQ1asin(A))

Computes the inverse cosine of an IQ1 type input.

Parameters
AIQ1 input.
Returns
IQ1 type result of inverse cosine operation.

§ _IQacos

#define _IQacos (   A)    _IQ24acos(A)

Computes the inverse cosine of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of inverse cosine operation.

§ _IQatan2

#define _IQatan2 (   A,
 
)    _IQ24atan2(A, B)

Compute the 4-quadrant arctangent of a global IQ format input, in radians.

Parameters
AGlobal IQ format input.
BGlobal IQ format input.
Returns
Global IQ type result of 4-quadrant arctangent.

§ _IQatan2PU

#define _IQatan2PU (   A,
 
)    _IQ24atan2PU(A, B)

Compute the 4-quadrant arctangent of a global IQ format input.

Parameters
AGlobal IQ format input.
BGlobal IQ format input.
Returns
Global IQ type per-unit result of 4-quadrant arctangent.

§ _IQ29atan

#define _IQ29atan (   A)    _IQ29atan2(A, _IQ29(1.0))

Computes the inverse tangnet of an IQ29 format input.

Parameters
AIQ29 format input.
Returns
IQ29 type result of inverse tangent operation.

§ _IQ28atan

#define _IQ28atan (   A)    _IQ28atan2(A, _IQ28(1.0))

Computes the inverse tangnet of an IQ28 format input.

Parameters
AIQ28 format input.
Returns
IQ28 type result of inverse tangent operation.

§ _IQ27atan

#define _IQ27atan (   A)    _IQ27atan2(A, _IQ27(1.0))

Computes the inverse tangnet of an IQ27 format input.

Parameters
AIQ27 format input.
Returns
IQ27 type result of inverse tangent operation.

§ _IQ26atan

#define _IQ26atan (   A)    _IQ26atan2(A, _IQ26(1.0))

Computes the inverse tangnet of an IQ26 format input.

Parameters
AIQ26 format input.
Returns
IQ26 type result of inverse tangent operation.

§ _IQ25atan

#define _IQ25atan (   A)    _IQ25atan2(A, _IQ25(1.0))

Computes the inverse tangnet of an IQ25 format input.

Parameters
AIQ25 format input.
Returns
IQ25 type result of inverse tangent operation.

§ _IQ24atan

#define _IQ24atan (   A)    _IQ24atan2(A, _IQ24(1.0))

Computes the inverse tangnet of an IQ24 format input.

Parameters
AIQ24 format input.
Returns
IQ24 type result of inverse tangent operation.

§ _IQ23atan

#define _IQ23atan (   A)    _IQ23atan2(A, _IQ23(1.0))

Computes the inverse tangnet of an IQ23 format input.

Parameters
AIQ23 format input.
Returns
IQ23 type result of inverse tangent operation.

§ _IQ22atan

#define _IQ22atan (   A)    _IQ22atan2(A, _IQ22(1.0))

Computes the inverse tangnet of an IQ22 format input.

Parameters
AIQ22 format input.
Returns
IQ22 type result of inverse tangent operation.

§ _IQ21atan

#define _IQ21atan (   A)    _IQ21atan2(A, _IQ21(1.0))

Computes the inverse tangnet of an IQ21 format input.

Parameters
AIQ21 format input.
Returns
IQ21 type result of inverse tangent operation.

§ _IQ20atan

#define _IQ20atan (   A)    _IQ20atan2(A, _IQ20(1.0))

Computes the inverse tangnet of an IQ20 format input.

Parameters
AIQ20 format input.
Returns
IQ20 type result of inverse tangent operation.

§ _IQ19atan

#define _IQ19atan (   A)    _IQ19atan2(A, _IQ19(1.0))

Computes the inverse tangnet of an IQ19 format input.

Parameters
AIQ19 format input.
Returns
IQ19 type result of inverse tangent operation.

§ _IQ18atan

#define _IQ18atan (   A)    _IQ18atan2(A, _IQ18(1.0))

Computes the inverse tangnet of an IQ18 format input.

Parameters
AIQ18 format input.
Returns
IQ18 type result of inverse tangent operation.

§ _IQ17atan

#define _IQ17atan (   A)    _IQ17atan2(A, _IQ17(1.0))

Computes the inverse tangnet of an IQ17 format input.

Parameters
AIQ17 format input.
Returns
IQ17 type result of inverse tangent operation.

§ _IQ16atan

#define _IQ16atan (   A)    _IQ16atan2(A, _IQ16(1.0))

Computes the inverse tangnet of an IQ16 format input.

Parameters
AIQ16 format input.
Returns
IQ16 type result of inverse tangent operation.

§ _IQ15atan

#define _IQ15atan (   A)    _IQ15atan2(A, _IQ15(1.0))

Computes the inverse tangnet of an IQ15 format input.

Parameters
AIQ15 format input.
Returns
IQ15 type result of inverse tangent operation.

§ _IQ14atan

#define _IQ14atan (   A)    _IQ14atan2(A, _IQ14(1.0))

Computes the inverse tangnet of an IQ14 format input.

Parameters
AIQ14 format input.
Returns
IQ14 type result of inverse tangent operation.

§ _IQ13atan

#define _IQ13atan (   A)    _IQ13atan2(A, _IQ13(1.0))

Computes the inverse tangnet of an IQ13 format input.

Parameters
AIQ13 format input.
Returns
IQ13 type result of inverse tangent operation.

§ _IQ12atan

#define _IQ12atan (   A)    _IQ12atan2(A, _IQ12(1.0))

Computes the inverse tangnet of an IQ12 format input.

Parameters
AIQ12 format input.
Returns
IQ12 type result of inverse tangent operation.

§ _IQ11atan

#define _IQ11atan (   A)    _IQ11atan2(A, _IQ11(1.0))

Computes the inverse tangnet of an IQ11 format input.

Parameters
AIQ11 format input.
Returns
IQ11 type result of inverse tangent operation.

§ _IQ10atan

#define _IQ10atan (   A)    _IQ10atan2(A, _IQ10(1.0))

Computes the inverse tangnet of an IQ10 format input.

Parameters
AIQ10 format input.
Returns
IQ10 type result of inverse tangent operation.

§ _IQ9atan

#define _IQ9atan (   A)    _IQ9atan2(A, _IQ9(1.0))

Computes the inverse tangnet of an IQ9 format input.

Parameters
AIQ9 format input.
Returns
IQ9 type result of inverse tangent operation.

§ _IQ8atan

#define _IQ8atan (   A)    _IQ8atan2(A, _IQ8(1.0))

Computes the inverse tangnet of an IQ8 format input.

Parameters
AIQ8 format input.
Returns
IQ8 type result of inverse tangent operation.

§ _IQ7atan

#define _IQ7atan (   A)    _IQ7atan2(A, _IQ7(1.0))

Computes the inverse tangnet of an IQ7 format input.

Parameters
AIQ7 format input.
Returns
IQ7 type result of inverse tangent operation.

§ _IQ6atan

#define _IQ6atan (   A)    _IQ6atan2(A, _IQ6(1.0))

Computes the inverse tangnet of an IQ6 format input.

Parameters
AIQ6 format input.
Returns
IQ6 type result of inverse tangent operation.

§ _IQ5atan

#define _IQ5atan (   A)    _IQ5atan2(A, _IQ5(1.0))

Computes the inverse tangnet of an IQ5 format input.

Parameters
AIQ5 format input.
Returns
IQ5 type result of inverse tangent operation.

§ _IQ4atan

#define _IQ4atan (   A)    _IQ4atan2(A, _IQ4(1.0))

Computes the inverse tangnet of an IQ4 format input.

Parameters
AIQ4 format input.
Returns
IQ4 type result of inverse tangent operation.

§ _IQ3atan

#define _IQ3atan (   A)    _IQ3atan2(A, _IQ3(1.0))

Computes the inverse tangnet of an IQ3 format input.

Parameters
AIQ3 format input.
Returns
IQ3 type result of inverse tangent operation.

§ _IQ2atan

#define _IQ2atan (   A)    _IQ2atan2(A, _IQ2(1.0))

Computes the inverse tangnet of an IQ2 format input.

Parameters
AIQ2 format input.
Returns
IQ2 type result of inverse tangent operation.

§ _IQ1atan

#define _IQ1atan (   A)    _IQ1atan2(A, _IQ1(1.0))

Computes the inverse tangnet of an IQ1 format input.

Parameters
AIQ1 format input.
Returns
IQ1 type result of inverse tangent operation.

§ _IQatan

#define _IQatan (   A)    _IQ24atan2(A, _IQ24(1.0))

Computes the inverse tangent of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of the inverse tangent.

§ _IQsqrt

#define _IQsqrt (   A)    _IQ24sqrt(A)

Calculate square root of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of the square root operation.

§ _IQisqrt

#define _IQisqrt (   A)    _IQ24isqrt(A)

Computes 1 over the square root of a global IQ format number.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of inverse square root operation.

§ _IQexp

#define _IQexp (   A)    _IQ24exp(A)

Computes the exponential of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of exponential.

§ _IQlog

#define _IQlog (   A)    _IQ24log(A)

Computes the base-e logarithm of a global IQ format input.

Parameters
AGlobal IQ format input.
Returns
Global IQ type result of base-e logarithm.

§ _IQ30int

#define _IQ30int (   A)    ((A) >> 30)

Returns the integer portion of an IQ30 type number.

Parameters
AIQ30 type input.
Returns
Iinteger portion of input.

§ _IQ29int

#define _IQ29int (   A)    ((A) >> 29)

Returns the integer portion of an IQ29 type number.

Parameters
AIQ29 type input.
Returns
Iinteger portion of input.

§ _IQ28int

#define _IQ28int (   A)    ((A) >> 28)

Returns the integer portion of an IQ28 type number.

Parameters
AIQ28 type input.
Returns
Iinteger portion of input.

§ _IQ27int

#define _IQ27int (   A)    ((A) >> 27)

Returns the integer portion of an IQ27 type number.

Parameters
AIQ27 type input.
Returns
Iinteger portion of input.

§ _IQ26int

#define _IQ26int (   A)    ((A) >> 26)

Returns the integer portion of an IQ26 type number.

Parameters
AIQ26 type input.
Returns
Iinteger portion of input.

§ _IQ25int

#define _IQ25int (   A)    ((A) >> 25)

Returns the integer portion of an IQ25 type number.

Parameters
AIQ25 type input.
Returns
Iinteger portion of input.

§ _IQ24int

#define _IQ24int (   A)    ((A) >> 24)

Returns the integer portion of an IQ24 type number.

Parameters
AIQ24 type input.
Returns
Iinteger portion of input.

§ _IQ23int

#define _IQ23int (   A)    ((A) >> 23)

Returns the integer portion of an IQ23 type number.

Parameters
AIQ23 type input.
Returns
Iinteger portion of input.

§ _IQ22int

#define _IQ22int (   A)    ((A) >> 22)

Returns the integer portion of an IQ22 type number.

Parameters
AIQ22 type input.
Returns
Iinteger portion of input.

§ _IQ21int

#define _IQ21int (   A)    ((A) >> 21)

Returns the integer portion of an IQ21 type number.

Parameters
AIQ21 type input.
Returns
Iinteger portion of input.

§ _IQ20int

#define _IQ20int (   A)    ((A) >> 20)

Returns the integer portion of an IQ20 type number.

Parameters
AIQ20 type input.
Returns
Iinteger portion of input.

§ _IQ19int

#define _IQ19int (   A)    ((A) >> 19)

Returns the integer portion of an IQ19 type number.

Parameters
AIQ19 type input.
Returns
Iinteger portion of input.

§ _IQ18int

#define _IQ18int (   A)    ((A) >> 18)

Returns the integer portion of an IQ18 type number.

Parameters
AIQ18 type input.
Returns
Iinteger portion of input.

§ _IQ17int

#define _IQ17int (   A)    ((A) >> 17)

Returns the integer portion of an IQ17 type number.

Parameters
AIQ17 type input.
Returns
Iinteger portion of input.

§ _IQ16int

#define _IQ16int (   A)    ((A) >> 16)

Returns the integer portion of an IQ16 type number.

Parameters
AIQ16 type input.
Returns
Iinteger portion of input.

§ _IQ15int

#define _IQ15int (   A)    ((A) >> 15)

Returns the integer portion of an IQ15 type number.

Parameters
AIQ15 type input.
Returns
Iinteger portion of input.

§ _IQ14int

#define _IQ14int (   A)    ((A) >> 14)

Returns the integer portion of an IQ14 type number.

Parameters
AIQ14 type input.
Returns
Iinteger portion of input.

§ _IQ13int

#define _IQ13int (   A)    ((A) >> 13)

Returns the integer portion of an IQ13 type number.

Parameters
AIQ13 type input.
Returns
Iinteger portion of input.

§ _IQ12int

#define _IQ12int (   A)    ((A) >> 12)

Returns the integer portion of an IQ12 type number.

Parameters
AIQ12 type input.
Returns
Iinteger portion of input.

§ _IQ11int

#define _IQ11int (   A)    ((A) >> 11)

Returns the integer portion of an IQ11 type number.

Parameters
AIQ11 type input.
Returns
Iinteger portion of input.

§ _IQ10int

#define _IQ10int (   A)    ((A) >> 10)

Returns the integer portion of an IQ10 type number.

Parameters
AIQ10 type input.
Returns
Iinteger portion of input.

§ _IQ9int

#define _IQ9int (   A)    ((A) >> 9)

Returns the integer portion of an IQ9 type number.

Parameters
AIQ9 type input.
Returns
Integer portion of input.

§ _IQ8int

#define _IQ8int (   A)    ((A) >> 8)

Returns the integer portion of an IQ8 type number.

Parameters
AIQ8 type input.
Returns
Integer portion of input.

§ _IQ7int

#define _IQ7int (   A)    ((A) >> 7)

Returns the integer portion of an IQ7 type number.

Parameters
AIQ7 type input.
Returns
Integer portion of input.

§ _IQ6int

#define _IQ6int (   A)    ((A) >> 6)

Returns the integer portion of an IQ6 type number.

Parameters
AIQ6 type input.
Returns
Integer portion of input.

§ _IQ5int

#define _IQ5int (   A)    ((A) >> 5)

Returns the integer portion of an IQ5 type number.

Parameters
AIQ5 type input.
Returns
Integer portion of input.

§ _IQ4int

#define _IQ4int (   A)    ((A) >> 4)

Returns the integer portion of an IQ4 type number.

Parameters
AIQ4 type input.
Returns
Integer portion of input.

§ _IQ3int

#define _IQ3int (   A)    ((A) >> 3)

Returns the integer portion of an IQ3 type number.

Parameters
AIQ3 type input.
Returns
Integer portion of input.

§ _IQ2int

#define _IQ2int (   A)    ((A) >> 2)

Returns the integer portion of an IQ2 type number.

Parameters
AIQ2 type input.
Returns
Integer portion of input.

§ _IQ1int

#define _IQ1int (   A)    ((A) >> 1)

Returns the integer portion of an IQ1 type number.

Parameters
AIQ1 type input.
Returns
Integer portion of input.

§ _IQint

#define _IQint (   A)    ((A) >> GLOBAL_IQ)

Returns the integer portion of a global IQ format number.

Parameters
AGlobal IQ format input.
Returns
Integer portion of input.

§ _IQfrac

#define _IQfrac (   A)    _IQ24frac(A)

Computes the fractional portion a global IQ format number.

Parameters
AGlobal IQ format input.
Returns
Global IQ format fractional portion of input.

§ _IQmpyIQX

#define _IQmpyIQX (   A,
  n1,
  B,
  n2 
)    _IQ24mpyIQX(A, n1, B, n2)

Multiply two IQ numbers in different IQ formats, returning the product in global IQ format.

Parameters
AIQN1 format input to be multiplied.
n1IQ format for first value.
BIQN2 format input to be multiplied.
n2IQ format for second value.
Returns
Global IQ format result of the multiplication.

§ _IQ30mag

#define _IQ30mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ30 numbers.

Parameters
AIQ30 type input.
BIQ30 type input
Returns
IQ30 result of magnitude operation.

§ _IQ29mag

#define _IQ29mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ29 numbers.

Parameters
AIQ29 type input.
BIQ29 type input
Returns
IQ29 result of magnitude operation.

§ _IQ28mag

#define _IQ28mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ28 numbers.

Parameters
AIQ28 type input.
BIQ28 type input
Returns
IQ28 result of magnitude operation.

§ _IQ27mag

#define _IQ27mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ27 numbers.

Parameters
AIQ27 type input.
BIQ27 type input
Returns
IQ27 result of magnitude operation.

§ _IQ26mag

#define _IQ26mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ26 numbers.

Parameters
AIQ26 type input.
BIQ26 type input
Returns
IQ26 result of magnitude operation.

§ _IQ25mag

#define _IQ25mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ25 numbers.

Parameters
AIQ25 type input.
BIQ25 type input
Returns
IQ25 result of magnitude operation.

§ _IQ24mag

#define _IQ24mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ24 numbers.

Parameters
AIQ24 type input.
BIQ24 type input
Returns
IQ24 result of magnitude operation.

§ _IQ23mag

#define _IQ23mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ23 numbers.

Parameters
AIQ23 type input.
BIQ23 type input
Returns
IQ23 result of magnitude operation.

§ _IQ22mag

#define _IQ22mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ22 numbers.

Parameters
AIQ22 type input.
BIQ22 type input
Returns
IQ22 result of magnitude operation.

§ _IQ21mag

#define _IQ21mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ21 numbers.

Parameters
AIQ21 type input.
BIQ21 type input
Returns
IQ21 result of magnitude operation.

§ _IQ20mag

#define _IQ20mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ20 numbers.

Parameters
AIQ20 type input.
BIQ20 type input
Returns
IQ20 result of magnitude operation.

§ _IQ19mag

#define _IQ19mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ19 numbers.

Parameters
AIQ19 type input.
BIQ19 type input
Returns
IQ19 result of magnitude operation.

§ _IQ18mag

#define _IQ18mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ18 numbers.

Parameters
AIQ18 type input.
BIQ18 type input
Returns
IQ18 result of magnitude operation.

§ _IQ17mag

#define _IQ17mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ17 numbers.

Parameters
AIQ17 type input.
BIQ17 type input
Returns
IQ17 result of magnitude operation.

§ _IQ16mag

#define _IQ16mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ16 numbers.

Parameters
AIQ16 type input.
BIQ16 type input
Returns
IQ16 result of magnitude operation.

§ _IQ15mag

#define _IQ15mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ15 numbers.

Parameters
AIQ15 type input.
BIQ15 type input
Returns
IQ15 result of magnitude operation.

§ _IQ14mag

#define _IQ14mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ14 numbers.

Parameters
AIQ14 type input.
BIQ14 type input
Returns
IQ14 result of magnitude operation.

§ _IQ13mag

#define _IQ13mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ13 numbers.

Parameters
AIQ13 type input.
BIQ13 type input
Returns
IQ13 result of magnitude operation.

§ _IQ12mag

#define _IQ12mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ12 numbers.

Parameters
AIQ12 type input.
BIQ12 type input
Returns
IQ12 result of magnitude operation.

§ _IQ11mag

#define _IQ11mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ11 numbers.

Parameters
AIQ11 type input.
BIQ11 type input
Returns
IQ11 result of magnitude operation.

§ _IQ10mag

#define _IQ10mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ10 numbers.

Parameters
AIQ10 type input.
BIQ10 type input
Returns
IQ10 result of magnitude operation.

§ _IQ9mag

#define _IQ9mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ9 numbers.

Parameters
AIQ9 type input.
BIQ9 type input
Returns
IQ9 result of magnitude operation.

§ _IQ8mag

#define _IQ8mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ8 numbers.

Parameters
AIQ8 type input.
BIQ8 type input
Returns
IQ8 result of magnitude operation.

§ _IQ7mag

#define _IQ7mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ7 numbers.

Parameters
AIQ7 type input.
BIQ7 type input
Returns
IQ7 result of magnitude operation.

§ _IQ6mag

#define _IQ6mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ6 numbers.

Parameters
AIQ6 type input.
BIQ6 type input
Returns
IQ6 result of magnitude operation.

§ _IQ5mag

#define _IQ5mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ5 numbers.

Parameters
AIQ5 type input.
BIQ5 type input
Returns
IQ5 result of magnitude operation.

§ _IQ4mag

#define _IQ4mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ4 numbers.

Parameters
AIQ4 type input.
BIQ4 type input
Returns
IQ4 result of magnitude operation.

§ _IQ3mag

#define _IQ3mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ3 numbers.

Parameters
AIQ3 type input.
BIQ3 type input
Returns
IQ3 result of magnitude operation.

§ _IQ2mag

#define _IQ2mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ2 numbers.

Parameters
AIQ2 type input.
BIQ2 type input
Returns
IQ2 result of magnitude operation.

§ _IQ1mag

#define _IQ1mag (   A,
 
)    _IQmag(A, B)

Computes the square root of A^2 + B^2 using IQ1 numbers.

Parameters
AIQ1 type input.
BIQ1 type input
Returns
IQ1 result of magnitude operation.

§ _IQimag

#define _IQimag (   A,
 
)    _IQ24imag(A, B)

Computes the inverse square root of A^2 + B^2 using IQ1 numbers.

Parameters
AGlobal IQ format input.
BGlobal IQ format input
Returns
Global IQ format result of inverse magnitude operation.

§ _atoIQ

#define _atoIQ (   A)    _atoIQ24(A)

Converts a string into a global IQ format number.

Parameters
AString input.
Returns
Global IQ format result of conversion.

§ _IQtoa

#define _IQtoa (   A,
  B,
 
)    _IQ24toa(A, B, C)

Converts a global IQ format input into a string.

Parameters
APointer to the buffer to store the converted IQ number.
BThe format string specifying how to convert the IQ number.
CGlobal IQ format input.
Returns
Returns 0 if there is no error, 1 if the width is too small to hold the integer characters, and 2 if an illegal format was specified.

§ _IQ30abs

#define _IQ30abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ30 number.

Parameters
AIQ30 type input.
Returns
IQ30 type absolute value of input.

§ _IQ29abs

#define _IQ29abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ29 number.

Parameters
AIQ29 type input.
Returns
IQ29 type absolute value of input.

§ _IQ28abs

#define _IQ28abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ28 number.

Parameters
AIQ28 type input.
Returns
IQ28 type absolute value of input.

§ _IQ27abs

#define _IQ27abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ27 number.

Parameters
AIQ27 type input.
Returns
IQ27 type absolute value of input.

§ _IQ26abs

#define _IQ26abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ26 number.

Parameters
AIQ26 type input.
Returns
IQ26 type absolute value of input.

§ _IQ25abs

#define _IQ25abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ25 number.

Parameters
AIQ25 type input.
Returns
IQ25 type absolute value of input.

§ _IQ24abs

#define _IQ24abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ24 number.

Parameters
AIQ24 type input.
Returns
IQ24 type absolute value of input.

§ _IQ23abs

#define _IQ23abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ23 number.

Parameters
AIQ23 type input.
Returns
IQ23 type absolute value of input.

§ _IQ22abs

#define _IQ22abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ22 number.

Parameters
AIQ22 type input.
Returns
IQ22 type absolute value of input.

§ _IQ21abs

#define _IQ21abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ21 number.

Parameters
AIQ21 type input.
Returns
IQ21 type absolute value of input.

§ _IQ20abs

#define _IQ20abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ20 number.

Parameters
AIQ20 type input.
Returns
IQ20 type absolute value of input.

§ _IQ19abs

#define _IQ19abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ19 number.

Parameters
AIQ19 type input.
Returns
IQ19 type absolute value of input.

§ _IQ18abs

#define _IQ18abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ18 number.

Parameters
AIQ18 type input.
Returns
IQ18 type absolute value of input.

§ _IQ17abs

#define _IQ17abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ17 number.

Parameters
AIQ17 type input.
Returns
IQ17 type absolute value of input.

§ _IQ16abs

#define _IQ16abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ16 number.

Parameters
AIQ16 type input.
Returns
IQ16 type absolute value of input.

§ _IQ15abs

#define _IQ15abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ15 number.

Parameters
AIQ15 type input.
Returns
IQ15 type absolute value of input.

§ _IQ14abs

#define _IQ14abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ14 number.

Parameters
AIQ14 type input.
Returns
IQ14 type absolute value of input.

§ _IQ13abs

#define _IQ13abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ13 number.

Parameters
AIQ13 type input.
Returns
IQ13 type absolute value of input.

§ _IQ12abs

#define _IQ12abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ12 number.

Parameters
AIQ12 type input.
Returns
IQ12 type absolute value of input.

§ _IQ11abs

#define _IQ11abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ11 number.

Parameters
AIQ11 type input.
Returns
IQ11 type absolute value of input.

§ _IQ10abs

#define _IQ10abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ10 number.

Parameters
AIQ10 type input.
Returns
IQ10 type absolute value of input.

§ _IQ9abs

#define _IQ9abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ9 number.

Parameters
AIQ9 type input.
Returns
IQ9 type absolute value of input.

§ _IQ8abs

#define _IQ8abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ8 number.

Parameters
AIQ8 type input.
Returns
IQ8 type absolute value of input.

§ _IQ7abs

#define _IQ7abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ7 number.

Parameters
AIQ7 type input.
Returns
IQ7 type absolute value of input.

§ _IQ6abs

#define _IQ6abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ6 number.

Parameters
AIQ6 type input.
Returns
IQ6 type absolute value of input.

§ _IQ5abs

#define _IQ5abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ5 number.

Parameters
AIQ5 type input.
Returns
IQ5 type absolute value of input.

§ _IQ4abs

#define _IQ4abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ4 number.

Parameters
AIQ4 type input.
Returns
IQ4 type absolute value of input.

§ _IQ3abs

#define _IQ3abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ3 number.

Parameters
AIQ3 type input.
Returns
IQ3 type absolute value of input.

§ _IQ2abs

#define _IQ2abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ2 number.

Parameters
AIQ2 type input.
Returns
IQ2 type absolute value of input.

§ _IQ1abs

#define _IQ1abs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an IQ1 number.

Parameters
AIQ1 type input.
Returns
IQ1 type absolute value of input.

§ _IQabs

#define _IQabs (   A)    (((A) < 0) ? - (A) : (A))

Computes the absolute value of an global IQ format number.

Parameters
AGlobal IQ format input.
Returns
GlobalIQ format absolute value of input.

Referenced by __IQNatan2().

Function Documentation

§ _IQmag()

int32_t _IQmag ( int32_t  a,
int32_t  b 
)

Calculate the magnitude of two IQ31 inputs.

Parameters
aIQ31 type input.
bIQ31 type input.
Returns
IQ31 type result of the magnitude operation.

References __IQNsqrt(), and TYPE_MAG.

© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale