aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libfixmath/fix16.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libfixmath/fix16.h b/libfixmath/fix16.h
index 8c5e9da..644776b 100644
--- a/libfixmath/fix16.h
+++ b/libfixmath/fix16.h
@@ -70,7 +70,7 @@ static inline fix16_t fix16_from_dbl(double a)
{
double temp = a * fix16_one;
#ifndef FIXMATH_NO_ROUNDING
- temp += (temp >= 0) ? 0.5f : -0.5f;
+ temp += (double)((temp >= 0) ? 0.5f : -0.5f);
#endif
return (fix16_t)temp;
}