|
sarmfsw: SMFSW Toolbox (desinged for ARM / compatible with other 8b/16b/32b platforms) 4.0rc
SMFSW collection of miscellaneous functions \& macros (desinged for ARM / compatible with other 8b/16b/32b platforms)
|
Floating point manipulation inlines. More...
#include <math.h>

Data Structures | |
| struct | sIntFrac |
| Float representation on integers. More... | |
Macros | |
| #define | SPLIT_FLOAT_TO_INTS(val, nb_frac) |
| < | |
Functions | |
| DWORD | get_fp_dec (const double f, const BYTE nb) |
| Get floating point number decimal part (as absolute value) | |
| void | float2sIntFrac (sIntFrac *const pIntFrac, const double f, const uint8_t nb_frac) |
| Convert floating point representation to sIntFrac integers representation. | |
| void | sIntFrac2float (double *const pFloat, const sIntFrac *const pIntFrac) |
| Convert sIntFrac integers representation to floating point representation. | |
Floating point manipulation inlines.
| #define SPLIT_FLOAT_TO_INTS | ( | val, | |
| nb_frac ) |
<
val into 2 integers with nb_frac fractional part digits
|
inline |
Convert floating point representation to sIntFrac integers representation.
| [in,out] | pIntFrac | - Pointer to result structure |
| [in] | f | - floating point value to convert |
| [in] | nb_frac | - Number of decimal to get after floating point (limited to 9 internally for proper result on 32b return type) |

Get floating point number decimal part (as absolute value)
| [in] | f | - floating point value |
| [in] | nb | - Number of decimal to get after floating point (limited to 9 internally for proper result on 32b return type) |
