Fixed possible rounding in the VERSION_BCD() macros for some 0.01 step increments (thanks to Oliver Zander).

This commit is contained in:
Dean Camera 2012-09-12 17:23:53 +00:00
parent 6936fcbd60
commit cd40797a4d
2 changed files with 3 additions and 2 deletions

View file

@ -724,8 +724,8 @@
/* Macros: */
#define VERSION_TENS(x) (int)((int)(x) / 10)
#define VERSION_ONES(x) (int)((int)(x) % 10)
#define VERSION_TENTHS(x) (int)(((x * 1) - ((int)(x * 1))) * 10)
#define VERSION_HUNDREDTHS(x) (int)(((x * 10) - ((int)(x * 10))) * 10)
#define VERSION_TENTHS(x) (int)((x - (int)x) * 10)
#define VERSION_HUNDREDTHS(x) (int)((x * 100) - ((int)(x * 10) * 10))
#endif
/* Disable C linkage for C++ Compilers: */