summaryrefslogtreecommitdiff
path: root/n/avr/modules/math/fixed/fixed.h
diff options
context:
space:
mode:
authorschodet2005-08-18 19:57:13 +0000
committerschodet2005-08-18 19:57:13 +0000
commit0267a146f28e7f43d6499159911ffcbb4cb69155 (patch)
treee08d165f7f585bb13fc74ecbbd74c49558d4acd1 /n/avr/modules/math/fixed/fixed.h
parenta9573e8c2aee1aeff25c1a49a030a99e939acaff (diff)
Ajout du calcul de racine carré.
Diffstat (limited to 'n/avr/modules/math/fixed/fixed.h')
-rw-r--r--n/avr/modules/math/fixed/fixed.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/n/avr/modules/math/fixed/fixed.h b/n/avr/modules/math/fixed/fixed.h
index ce3138f..9c031dc 100644
--- a/n/avr/modules/math/fixed/fixed.h
+++ b/n/avr/modules/math/fixed/fixed.h
@@ -25,6 +25,18 @@
*
* }}} */
+/** Numbers notation:
+ * [u]{i|f}x[.y]
+ * u: unsigned
+ * i: integer
+ * f: fixed point
+ * x: integral part size in bits
+ * y: fractionnal part size in bits
+ *
+ * Ex: i16: signed 16 bit word, uf8.8: unsigned fixed 8.8.
+ *
+ * Angles are mapped from [0, 2pi) to [0,1). */
+
#ifndef HOST
/** Multiply f8.24 by f8.24, return f8.24. */
@@ -57,4 +69,12 @@ fixed_cos_f824 (int32_t a);
int32_t
fixed_sin_f824 (int32_t a);
+/** Compute square root, uf24.8. */
+uint32_t
+fixed_sqrt_uf248 (uint32_t x);
+
+/** Compute square root, ui32 -> ui16. */
+uint16_t
+fixed_sqrt_ui32 (uint32_t x);
+
#endif /* fixed_h */