From 40ef134f4d9f880a4f8848b1ac36ba993d9afa8c Mon Sep 17 00:00:00 2001 From: "Petteri.Aimonen" Date: Sun, 5 Aug 2012 16:11:40 +0000 Subject: Add fix16_sq() inline function as a shorthand to square values --- libfixmath/fix16.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libfixmath/fix16.h b/libfixmath/fix16.h index 0767627..1508aaf 100644 --- a/libfixmath/fix16.h +++ b/libfixmath/fix16.h @@ -187,7 +187,10 @@ static inline fix16_t fix16_deg_to_rad(fix16_t degrees) */ extern fix16_t fix16_sqrt(fix16_t inValue) FIXMATH_FUNC_ATTRS; - +/*! Returns the square of the given fix16_t. +*/ +static inline fix16_t fix16_sq(fix16_t x) + { return fix16_mul(x, x); } /*! Returns the exponent (e^) of the given fix16_t. */ -- cgit v1.2.3