PandA-2024.02
|
#include <stdint.h>
Go to the source code of this file.
Typedefs | |
typedef int32_t | fixedpt |
typedef int64_t | fixedptd |
typedef uint32_t | fixedptu |
typedef uint64_t | fixedptud |
Functions | |
fixedpt | fixedpt_mul (fixedpt A, fixedpt B) |
fixedpt | fixedpt_div (fixedpt A, fixedpt B) |
void | fixedpt_str (fixedpt A, char *str, int max_dec) |
Convert the given fixedpt number to a decimal string. More... | |
char * | fixedpt_cstr (const fixedpt A, const int max_dec) |
fixedpt | fixedpt_sqrt (fixedpt A) |
fixedpt | fixedpt_sin (fixedpt fp) |
fixedpt | fixedpt_cos (fixedpt A) |
fixedpt | fixedpt_tan (fixedpt A) |
fixedpt | fixedpt_exp (fixedpt fp) |
fixedpt | fixedpt_ln (fixedpt x) |
fixedpt | fixedpt_log (fixedpt x, fixedpt base) |
fixedpt | fixedpt_pow (fixedpt n, fixedpt exp) |
void | fixedpt_print (fixedpt A) |
void | fixedpt_print_file (fixedpt A) |
#define FIXEDPT_BITS 32 |
Definition at line 75 of file fixedptc.h.
#define FIXEDPT_E fixedpt_rconst(2.7182818284590452354) |
Definition at line 124 of file fixedptc.h.
#define FIXEDPT_FBITS (FIXEDPT_BITS - FIXEDPT_WBITS) |
Definition at line 104 of file fixedptc.h.
#define FIXEDPT_FMASK (((fixedpt)1 << FIXEDPT_FBITS) - 1) |
Definition at line 105 of file fixedptc.h.
#define fixedpt_fracpart | ( | A | ) | ((fixedpt)(A) & FIXEDPT_FMASK) |
Definition at line 116 of file fixedptc.h.
#define fixedpt_fromint | ( | I | ) | ((fixedptd)(I) << FIXEDPT_FBITS) |
Definition at line 108 of file fixedptc.h.
#define FIXEDPT_HALF_PI fixedpt_rconst(3.14159265358979323846 / 2) |
Definition at line 123 of file fixedptc.h.
#define FIXEDPT_ONE ((fixedpt)((fixedpt)1 << FIXEDPT_FBITS)) |
Definition at line 118 of file fixedptc.h.
#define FIXEDPT_ONE_HALF (FIXEDPT_ONE >> 1) |
Definition at line 119 of file fixedptc.h.
#define FIXEDPT_PI fixedpt_rconst(3.14159265358979323846) |
Definition at line 121 of file fixedptc.h.
#define fixedpt_rconst | ( | R | ) | ((fixedpt)((R) * FIXEDPT_ONE + ((R) >= 0 ? 0.5 : -0.5))) |
Definition at line 107 of file fixedptc.h.
#define fixedpt_toint | ( | F | ) | ((F) >> FIXEDPT_FBITS) |
Definition at line 109 of file fixedptc.h.
#define FIXEDPT_TWO (FIXEDPT_ONE + FIXEDPT_ONE) |
Definition at line 120 of file fixedptc.h.
#define FIXEDPT_TWO_PI fixedpt_rconst(2 * 3.14159265358979323846) |
Definition at line 122 of file fixedptc.h.
#define FIXEDPT_VCSID "$Id$" |
Definition at line 102 of file fixedptc.h.
#define FIXEDPT_WBITS 16 |
Definition at line 95 of file fixedptc.h.
Definition at line 114 of file fixedptc.h.
Definition at line 112 of file fixedptc.h.
typedef int32_t fixedpt |
Definition at line 79 of file fixedptc.h.
typedef int64_t fixedptd |
Definition at line 80 of file fixedptc.h.
typedef uint32_t fixedptu |
Definition at line 81 of file fixedptc.h.
typedef uint64_t fixedptud |
Definition at line 82 of file fixedptc.h.
Definition at line 162 of file fixedptc.c.
char* fixedpt_cstr | ( | const fixedpt | A, |
const int | max_dec | ||
) |
Definition at line 88 of file fixedptc.c.
Definition at line 17 of file fixedptc.c.
Definition at line 174 of file fixedptc.c.
Definition at line 259 of file fixedptc.c.
Definition at line 298 of file fixedptc.c.
Definition at line 11 of file fixedptc.c.
Definition at line 304 of file fixedptc.c.
void fixedpt_print | ( | fixedpt | A | ) |
void fixedpt_print_file | ( | fixedpt | A | ) |
Definition at line 130 of file fixedptc.c.
Definition at line 96 of file fixedptc.c.
void fixedpt_str | ( | fixedpt | A, |
char * | str, | ||
int | max_dec | ||
) |
Convert the given fixedpt number to a decimal string.
The max_dec argument specifies how many decimal digits to the right of the decimal point to generate. If set to -1, the "default" number of decimal digits will be used (2 for 32-bit fixedpt width, 10 for 64-bit fixedpt width); If set to -2, "all" of the digits will be returned, meaning there will be invalid, bogus digits outside the specified precisions.
Definition at line 35 of file fixedptc.c.
Definition at line 168 of file fixedptc.c.