#include <68332/types.h>
Go to the source code of this file.
Defines | |
#define | INT_TO_FIXED(x) ((x) << 16) |
#define | DOUBLE_TO_FIXED(x) ((long)((x) * 65536.0 + 0.5)) |
#define | FIXED_TO_INT(x) ((x) >> 16) |
#define | FIXED_TO_DOUBLE(x) (((double)(x)) / 65536.0) |
#define | ROUND_FIXED_TO_INT(x) (((x) + 0x8000) >> 16) |
#define | FIXED_ONE INT_TO_FIXED(1) |
#define | FIXED_PIDIV4 51472L |
#define | FIXED_PIDIV2 102944L |
#define | FIXED_PI 205887L |
#define | FIXED_2PI 411775L |
#define | FIXED_E 178144L |
#define | FIXED_LN2 45426L |
#define | FIXED_SQRT2 92682L |
#define | FLOAT_PI 3.141592654 |
Functions | |
int32 | fpmul (int32 x, int32 y) |
int32 | fpdiv (int32 x, int32 y) |
int32 | fpsqrt (int32 x) |
int32 | fpsin (int32 x) |
int32 | fpcos (int32 x) |
int32 | fptan (int32 x) |
int32 | fpatan (int32 x) |
int32 | fpexp (int32 x) |
int32 | fpln (int32 x) |
To use the functions defined in this file, include <68332/fixedpoint.h> and link libfixed.a.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Multiplies two 16.16 fixed point numbers together, returning a 16.16 fixed point product. Note: No checking for overflow is performed.
|
|
Divides a 16.16 fixed point dividend by a 16.16 fixed point divisor, returning a 16.16 fixed point quotient. Note: No checking for underflow is performed.
|
|
Calculates the square root of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: No checking for underflow is performed.
|
|
Calculates the sine of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The input will be transformed to within the range of -FIXED_PI to +FIXED_PI.
|
|
Calculates the cosine of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The input will be transformed to within the range of -FIXED_PI to +FIXED_PI.
|
|
Calculates the tangent of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The input will be transformed to within the range of -FIXED_PI to +FIXED_PI. Note: The return value will be in the range of -32768.0 to 32767.999984741
|
|
Calculates the arctangent of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The return value will be in the range of -FIXED_PI/2 to FIXED_PI/2
|
|
Calculates the base e exponential of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: No checking for overflow is performed.
|
|
Calculates the base e logarithm of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: No checking for underflow is performed.
|