#include <aversive.h>
Go to the source code of this file.
Data Structures | |
struct | fixed_64 |
Defines | |
#define | f64_integer u.s.integer |
#define | f64_decimal u.s.decimal |
#define | F64_ZERO |
#define | F64_NAN |
#define | F64_IS_GT(x, y) (f64_to_s64(x) > f64_to_s64(y)) |
#define | F64_IS_LT(x, y) (f64_to_s64(x) < f64_to_s64(y)) |
#define | F64_IS_GE(x, y) (f64_to_s64(x) >= f64_to_s64(y)) |
#define | F64_IS_LE(x, y) (f64_to_s64(x) <= f64_to_s64(y)) |
#define | F64_IS_EQ(x, y) (f64_to_s64(x) == f64_to_s64(y)) |
#define | F64_IS_NE(x, y) (f64_to_s64(x) != f64_to_s64(y)) |
#define | F64_IS_NEG(x) ((x).f64_integer < 0) |
#define | F64_IS_ZERO(x) ((x).f64_integer == 0 && (x).f64_decimal == 0) |
Typedefs | |
typedef struct fixed_64 | f64 |
Functions | |
f64 | f64_from_double (double f) |
double | f64_to_double (f64 fix) |
f64 | f64_from_integer (int32_t i, uint32_t d) |
f64 | f64_from_msb (int32_t i) |
f64 | f64_from_lsb (int32_t i) |
f64 | f64_neg (f64 f) |
f64 | f64_add (f64 a, f64 b) |
f64 | f64_sub (f64 a, f64 b) |
f64 | f64_inv (f64 f) |
f64 | f64_mul (f64 a, f64 b) |
int32_t | f64_msb_mul (f64 a, f64 b) |
f64 | f64_div (f64 a, f64 b) |
f64 | f64_sqrt (f64 f) |
void | f64_print (f64 fix) |
#define F64_IS_EQ | ( | x, | |||
y | ) | (f64_to_s64(x) == f64_to_s64(y)) |
#define F64_IS_NEG | ( | x | ) | ((x).f64_integer < 0) |
#define F64_IS_ZERO | ( | x | ) | ((x).f64_integer == 0 && (x).f64_decimal == 0) |
#define F64_NAN |
Value:
Definition at line 62 of file f64.h.
Referenced by f64_div(), f64_inv(), f64_print(), and f64_sqrt().
#define F64_ZERO |
f64 f64_from_double | ( | double | f | ) |
convert a double to a f64
Definition at line 31 of file f64_double.c.
References parse_symbols::f, and POW2_32F.
Referenced by rs_set_left_ext_encoder(), and rs_set_right_ext_encoder().
f64 f64_from_integer | ( | int32_t | i, | |
uint32_t | d | |||
) |
convert 2 integer (int32_t and uint32_t) to a f64
Definition at line 27 of file f64_int.c.
References parse_symbols::f.
f64 f64_from_lsb | ( | int32_t | i | ) |
convert lsb integer (int32_t) to a f64 ( -0.5 < ret < 0.5 )
Definition at line 50 of file f64_int.c.
References parse_symbols::f.
Referenced by rs_update().
f64 f64_from_msb | ( | int32_t | i | ) |
convert msb integer (int32_t) to a f64
Definition at line 38 of file f64_int.c.
References parse_symbols::f.
return opposite of the number (=1/f)
Definition at line 27 of file f64_inv.c.
References F64_IS_ZERO, and F64_NAN.
Referenced by f64_div().
mul a with b (=a*b), but return only the msb
Definition at line 28 of file f64_msb_mul.c.
Referenced by rs_update().
mul a with b (=a*b)
Definition at line 28 of file f64_mul.c.
Referenced by f64_div(), and f64_sqrt().
void f64_print | ( | f64 | fix | ) |
function that display a f64 to the standard output
Definition at line 26 of file f64_print.c.
References F64_IS_EQ, F64_NAN, and f64_to_double().
sqrt of f
Definition at line 45 of file f64_sqrt.c.
References a, F64_IS_NEG, F64_IS_ZERO, f64_mul(), F64_NAN, and F64_ZERO.
double f64_to_double | ( | f64 | fix | ) |
convert a f64 to a double
Definition at line 40 of file f64_double.c.
References POW2_32F.
Referenced by f64_print().