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.
References FIXEDPT_HALF_PI, and fixedpt_sin().
Referenced by fixedpt_tan(), and get_two_normal_fixed().
char* fixedpt_cstr | ( | const fixedpt | A, |
const int | max_dec | ||
) |
Definition at line 88 of file fixedptc.c.
References __attribute__(), A, fixedpt_div(), FIXEDPT_FBITS, FIXEDPT_ONE, fixedpt_sqrt(), fixedpt_str(), and str.
Definition at line 17 of file fixedptc.c.
References FIXEDPT_FBITS.
Referenced by asset_path_fixed_simplified(), fixedpt_cstr(), fixedpt_exp(), fixedpt_ln(), fixedpt_log(), fixedpt_sqrt(), fixedpt_tan(), and processPhoton().
Definition at line 174 of file fixedptc.c.
References fixedpt_abs, fixedpt_div(), FIXEDPT_FBITS, FIXEDPT_FMASK, fixedpt_mul(), FIXEDPT_ONE, FIXEDPT_ONE_HALF, fixedpt_rconst, FIXEDPT_TWO, k, and R.
Referenced by asset_path_fixed_simplified(), and fixedpt_pow().
Definition at line 259 of file fixedptc.c.
References fixedpt_div(), FIXEDPT_FBITS, fixedpt_mul(), FIXEDPT_ONE, fixedpt_rconst, FIXEDPT_TWO, R, test_panda::table, and x.
Referenced by fixedpt_log(), fixedpt_pow(), get_two_normal_fixed(), and processPhoton().
Definition at line 298 of file fixedptc.c.
References fixedpt_div(), and fixedpt_ln().
Definition at line 11 of file fixedptc.c.
References B, and FIXEDPT_FBITS.
Referenced by asset_path_fixed_simplified(), fixedpt_exp(), fixedpt_ln(), fixedpt_pow(), fixedpt_sin(), get_two_normal_fixed(), and processPhoton().
Definition at line 304 of file fixedptc.c.
References fixedpt_exp(), fixedpt_ln(), fixedpt_mul(), and FIXEDPT_ONE.
void fixedpt_print | ( | fixedpt | A | ) |
void fixedpt_print_file | ( | fixedpt | A | ) |
Definition at line 130 of file fixedptc.c.
References FIXEDPT_HALF_PI, fixedpt_mul(), FIXEDPT_ONE, FIXEDPT_PI, fixedpt_rconst, result, and sign.
Referenced by fixedpt_cos(), fixedpt_tan(), and get_two_normal_fixed().
Definition at line 96 of file fixedptc.c.
References A, fixedpt_div(), FIXEDPT_FBITS, and FIXEDPT_ONE.
Referenced by asset_path_fixed_simplified(), fixedpt_cstr(), get_two_normal_fixed(), and processPhoton().
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.
References FIXEDPT_BITS, fixedpt_fracpart, fixedpt_toint, and FIXEDPT_WBITS.
Referenced by fixedpt_cstr().
Definition at line 168 of file fixedptc.c.
References fixedpt_cos(), fixedpt_div(), and fixedpt_sin().