#include <fix.h>
Operands are 32 bits in size with the binary point between bits 15 and 16.
Definition at line 160 of file fix.h.
Static Public Member Functions | |
| static IMPORT fix | Add (fix a, fix b) |
| static IMPORT fix | Sub (fix a, fix b) |
| static IMPORT fix | Mul (fix a, fix b) |
| static IMPORT fix | MulNS (fix a, fix b) |
| static IMPORT fix | Div (fix a, fix b) |
| static IMPORT fix | Sqrt (ufix a) |
| static IMPORT fix | Log2 (ufix a) |
| static IMPORT ufix | Exp2 (fix a) |
| static IMPORT fix | Sin (fixangle angle) |
| static IMPORT fix | Cos (fixangle angle) |
| static IMPORT fix | Tan (fixangle angle) |
| static IMPORT fixangle | ASin (fix value) |
| static IMPORT fixangle | ACos (fix value) |
| static IMPORT fixangle | ATan (fix value) |
| static IMPORT fix | Random (uint32_t &seed) |
| static IMPORT ufix | Random (uint32_t &seed, ufix range) |
|
||||||||||||
|
Add two fixed-point numbers. Produces saturated result on overflow. When the addition of two numbers is know not to cause overflow, or when this doesn't matter, normal integer addition (+) can be used instead...
|
|
||||||||||||
|
Subtract two fixed-point numbers. Produces saturated result on overflow. When the subtraction of two numbers is know not to cause overflow, or when this doesn't matter, normal integer subtraction (-) can be used instead...
|
|
||||||||||||
|
Multiply two fixed-point numbers. Produces saturated result on overflow. To multiply a fixed point number by an integer, normal integer multiplication (*) may be used... This does not detect overflow.
|
|
||||||||||||
|
Multiply two fixed-point numbers. This is a Non-Saturating (and faster) version of Mul(). On overflow the result is undefined. To multiply a fixed point number by an integer, normal integer multiplication (*) may be used...
|
|
||||||||||||
|
Divide two fixed-point numbers. Produces saturated result on overflow. Division by zero is treated as division by a very small number and produces a saturated result accordingly. To divide a fixed point number by an integer, normal integer division (/) may be used... This does not error conditions.
|
|
|
Calculate the square root of a fixed-point number.
|
|
|
Calculate the logarithm to base 2 of a fixed-point number . Accuracy is +/-8.40e-6 (+/-0.55 lsb).
|
|
|
Raise 2 to-the-power of a fixed-point number, (2^a). Accuracy is +/-1.14e-5 (+/-0.75 lsb).
|
|
|
Calculate the Sine of an angle. Accuracy is +/-8.55e-6 (+/-0.56 lsb).
|
|
|
Calculate the Cosine of an angle. Accuracy is +/-8.55e-6 (+/-0.56 lsb).
|
|
|
Calculate the Tangent of an angle. Accuracy is +/-1.01e-5 (+/-0.66 lsb).
|
|
|
Calculate the Arc-Sine of a value. Accuracy is +/-8.55e-6 (+/-0.56 lsb).
|
|
|
Calculate the Arc-Cosine of a value. Accuracy is +/-8.55e-6 (+/-0.56 lsb).
|
|
|
Calculate the Arc-Tangent of a value. Accuracy is +/-9.00e-6 (+/-0.59 lsb).
|
|
|
Generate a psuedo-random number.
|
|
||||||||||||
|
Generate a psuedo-random number.
|
1.4.4