EAFixedPoint.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
  2. <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  3. <title>EAFixedPoint</title>
  4. <meta name="author" content="Paul Pedriana">
  5. <link type="text/css" rel="stylesheet" href="UTFDoc.css">
  6. </head>
  7. <body bgcolor="#FFFFFF">
  8. <h1>EAFixedPoint</h1>
  9. <h2> <span style="font-weight: bold;">Introduction</span> </h2>
  10. <p>The EAFixedPoint module implements fixed point math via classic C macros and
  11. functions and via a more advanced implementation using C++ classes. The C++
  12. classes constitute a fairly complete implementation of a fixed point C++ numerical
  13. data type that acts much like the built-in float and double data types. </p>
  14. <p>The following code freely mixes the SFixed16 (signed 16:16 fixed point) data
  15. type with other numerical data types:</p>
  16. <pre><span style="font-family: monospace;"><span class="code-example">SFixed16_16 a(1), b(2), c(3);<br>float f(4.5f);<br>double d(3.2);<br>int i(6);
  17. <br>a = b * f;<br>a = (c / d) + b + f;<br>a = c / d * (b % i) + f / c;<br>a = i * -c / (b++);<br>a = sin(a) + pow(b, d) * sqrt(a);<br>a = log(a) / log(f);</span></span></pre>
  18. <p></p>
  19. <p>Fixed point math has a number of uses:</p>
  20. <ul>
  21. <li>Improved precision over floating point math.</li>
  22. <li>Improved speed over floating point math, particularly with respect to division.</li>
  23. <li>Consistent behaviour across CPUs, especially during network play when two
  24. different machines must behave identically but FPU behaviour may differ.</li>
  25. </ul>
  26. <p>Information about fixed point can be found on the Internet by simply searching
  27. for &quot;fixed point&quot; with your favorite search site.</p>
  28. <h2>Fixed point vs. floating point </h2>
  29. <p>Fixed point</p>
  30. <blockquote>
  31. <p>+ Can be very fast. Fixed point
  32. math executes at the same speed as integer math. Fixed to int conversions
  33. are much faster float to int.<br>
  34. + Executes concurrently with floating point math, due its use of integer math.<br>
  35. &#150; Limited range. Fixed point16:16 numbers are between -32767 and +32767.
  36. The fractional part is accurate to 1 / 65536. <br>
  37. &#150; Harder to code in high-level languages.</p>
  38. </blockquote>
  39. <p>Floating point</p>
  40. <blockquote>
  41. <p>+ Large range. The range for floating point numbers is typically in excess
  42. of 1e-100 to 1e+100 and have an accuracy of about 13 decimal places. <br>
  43. + Executes concurrently with integer math.<br>
  44. &#150; Can be slower. Generally
  45. fast for addition and multiplication but may be slower for division and float
  46. to int conversions. </p>
  47. </blockquote>
  48. <h2>Fixed point precision </h2>
  49. <p>The C++ fixed point classes provide varying precision via the use of template
  50. parameter constants. EAFixedPoint provides the following predefined C++ fixed
  51. point types</p>
  52. <table width="100%" border="1">
  53. <tr>
  54. <td><b>Type</b></td>
  55. <td><b>Signed</b></td>
  56. <td><b>Integral type</b></td>
  57. <td><b>Precision</b></td>
  58. </tr>
  59. <tr>
  60. <td><font face="Courier New, Courier, mono" size="-1">SFixed24_8</font></td>
  61. <td>signed</td>
  62. <td>32</td>
  63. <td>24 bits of integer, 8 bits of fraction</td>
  64. </tr>
  65. <tr>
  66. <td><font face="Courier New, Courier, mono" size="-1">UFixed24_8</font></td>
  67. <td>unsigned</td>
  68. <td>32</td>
  69. <td>24 bits of integer, 8 bits of fraction</td>
  70. </tr>
  71. <tr>
  72. <td><font face="Courier New, Courier, mono" size="-1">SFixed22_10</font></td>
  73. <td>signed</td>
  74. <td>32</td>
  75. <td>22 bits of integer, 10 bits of fraction</td>
  76. </tr>
  77. <tr>
  78. <td><font face="Courier New, Courier, mono" size="-1">UFixed22_10</font></td>
  79. <td>unsigned</td>
  80. <td>32</td>
  81. <td>22 bits of integer, 10 bits of fraction</td>
  82. </tr>
  83. <tr>
  84. <td><font face="Courier New, Courier, mono" size="-1">SFixed20_12</font></td>
  85. <td>signed</td>
  86. <td>32</td>
  87. <td>20 bits of integer, 12 bits of fraction</td>
  88. </tr>
  89. <tr>
  90. <td><font face="Courier New, Courier, mono" size="-1">UFixed20_12</font></td>
  91. <td>unsigned</td>
  92. <td>32</td>
  93. <td>20 bits of integer, 12 bits of fraction</td>
  94. </tr>
  95. <tr>
  96. <td><font face="Courier New, Courier, mono" size="-1">SFixed18_14</font></td>
  97. <td>signed</td>
  98. <td>32</td>
  99. <td>18 bits of integer, 14 bits of fraction</td>
  100. </tr>
  101. <tr>
  102. <td><font face="Courier New, Courier, mono" size="-1">UFixed18_14</font></td>
  103. <td>unsigned</td>
  104. <td>32</td>
  105. <td>18 bits of integer, 14 bits of fraction</td>
  106. </tr>
  107. <tr>
  108. <td><font face="Courier New, Courier, mono" size="-1">SFixed16_16</font></td>
  109. <td>signed</td>
  110. <td>32</td>
  111. <td>16 bits of integer, 16 bits of fraction</td>
  112. </tr>
  113. <tr>
  114. <td><font face="Courier New, Courier, mono" size="-1">UFixed16_16</font></td>
  115. <td>unsigned</td>
  116. <td>32</td>
  117. <td>16 bits of integer, 16 bits of fraction</td>
  118. </tr>
  119. <tr>
  120. <td><font face="Courier New, Courier, mono" size="-1">SFixed14_18</font></td>
  121. <td>signed</td>
  122. <td>32</td>
  123. <td>14 bits of integer, 18 bits of fraction</td>
  124. </tr>
  125. <tr>
  126. <td><font face="Courier New, Courier, mono" size="-1">UFixed14_18</font></td>
  127. <td>unsigned</td>
  128. <td>32</td>
  129. <td>14 bits of integer, 18 bits of fraction</td>
  130. </tr>
  131. <tr>
  132. <td><font face="Courier New, Courier, mono" size="-1">SFixed12_20</font></td>
  133. <td>signed</td>
  134. <td>32</td>
  135. <td>12 bits of integer, 20 bits of fraction</td>
  136. </tr>
  137. <tr>
  138. <td><font face="Courier New, Courier, mono" size="-1">UFixed12_20</font></td>
  139. <td>unsigned</td>
  140. <td>32</td>
  141. <td>12 bits of integer, 20 bits of fraction</td>
  142. </tr>
  143. <tr>
  144. <td><font face="Courier New, Courier, mono" size="-1">SFixed10_22</font></td>
  145. <td>signed</td>
  146. <td>32</td>
  147. <td>10 bits of integer, 22 bits of fraction</td>
  148. </tr>
  149. <tr>
  150. <td><font face="Courier New, Courier, mono" size="-1">UFixed10_22</font></td>
  151. <td>unsigned</td>
  152. <td>32</td>
  153. <td>10 bits of integer, 22 bits of fraction</td>
  154. </tr>
  155. <tr>
  156. <td><font face="Courier New, Courier, mono" size="-1">SFixed8_24</font></td>
  157. <td>signed</td>
  158. <td>32</td>
  159. <td>8 bits of integer, 24 bits of fraction</td>
  160. </tr>
  161. <tr>
  162. <td><font face="Courier New, Courier, mono" size="-1">UFixed8_24</font></td>
  163. <td>unsigned</td>
  164. <td>32</td>
  165. <td>8 bits of integer, 24 bits of fraction</td>
  166. </tr>
  167. <tr>
  168. <td>&nbsp;</td>
  169. <td>&nbsp;</td>
  170. <td>&nbsp;</td>
  171. <td>&nbsp;</td>
  172. </tr>
  173. <tr>
  174. <td><font face="Courier New, Courier, mono" size="-1">SFixed48_16</font></td>
  175. <td>signed</td>
  176. <td>64</td>
  177. <td>48 bits of integer, 16 bits of fraction.</td>
  178. </tr>
  179. <tr>
  180. <td><font face="Courier New, Courier, mono" size="-1">UFixed48_16</font></td>
  181. <td>unsigned</td>
  182. <td>64</td>
  183. <td>48 bits of integer, 16 bits of fraction.</td>
  184. </tr>
  185. <tr>
  186. <td><font face="Courier New, Courier, mono" size="-1">SFixed44_20</font></td>
  187. <td>signed</td>
  188. <td>64</td>
  189. <td>44 bits of integer, 20 bits of fraction.</td>
  190. </tr>
  191. <tr>
  192. <td><font face="Courier New, Courier, mono" size="-1">UFixed44_20</font></td>
  193. <td>unsigned</td>
  194. <td>64</td>
  195. <td>44 bits of integer, 20 bits of fraction.</td>
  196. </tr>
  197. <tr>
  198. <td><font face="Courier New, Courier, mono" size="-1">SFixed40_24</font></td>
  199. <td>signed</td>
  200. <td>64</td>
  201. <td>40 bits of integer, 24 bits of fraction.</td>
  202. </tr>
  203. <tr>
  204. <td><font face="Courier New, Courier, mono" size="-1">UFixed40_24</font></td>
  205. <td>unsigned</td>
  206. <td>64</td>
  207. <td>40 bits of integer, 24 bits of fraction.</td>
  208. </tr>
  209. <tr>
  210. <td><font face="Courier New, Courier, mono" size="-1">SFixed36_28</font></td>
  211. <td>signed</td>
  212. <td>64</td>
  213. <td>36 bits of integer, 28 bits of fraction.</td>
  214. </tr>
  215. <tr>
  216. <td><font face="Courier New, Courier, mono" size="-1">UFixed36_28</font></td>
  217. <td>unsigned</td>
  218. <td>64</td>
  219. <td>36 bits of integer, 28 bits of fraction.</td>
  220. </tr>
  221. <tr>
  222. <td><font face="Courier New, Courier, mono" size="-1">SFixed32_32</font></td>
  223. <td>signed</td>
  224. <td>64</td>
  225. <td>32 bits of integer, 32 bits of fraction.</td>
  226. </tr>
  227. <tr>
  228. <td><font face="Courier New, Courier, mono" size="-1">UFixed32_32</font></td>
  229. <td>unsigned</td>
  230. <td>64</td>
  231. <td>32 bits of integer, 32 bits of fraction.</td>
  232. </tr>
  233. <tr>
  234. <td><font face="Courier New, Courier, mono" size="-1">SFixed28_36</font></td>
  235. <td>signed</td>
  236. <td>64</td>
  237. <td>28 bits of integer, 36 bits of fraction.</td>
  238. </tr>
  239. <tr>
  240. <td><font face="Courier New, Courier, mono" size="-1">UFixed28_36</font></td>
  241. <td>unsigned</td>
  242. <td>64</td>
  243. <td>28 bits of integer, 36 bits of fraction.</td>
  244. </tr>
  245. <tr>
  246. <td><font face="Courier New, Courier, mono" size="-1">SFixed24_40</font></td>
  247. <td>signed</td>
  248. <td>64</td>
  249. <td>24 bits of integer, 40 bits of fraction.</td>
  250. </tr>
  251. <tr>
  252. <td><font face="Courier New, Courier, mono" size="-1">UFixed24_40</font></td>
  253. <td>unsigned</td>
  254. <td>64</td>
  255. <td>24 bits of integer, 40 bits of fraction.</td>
  256. </tr>
  257. <tr>
  258. <td><font face="Courier New, Courier, mono" size="-1">SFixed20_44</font></td>
  259. <td>signed</td>
  260. <td>64</td>
  261. <td>20 bits of integer, 44 bits of fraction.</td>
  262. </tr>
  263. <tr>
  264. <td><font face="Courier New, Courier, mono" size="-1">UFixed20_44</font></td>
  265. <td>unsigned</td>
  266. <td>64</td>
  267. <td>20 bits of integer, 44 bits of fraction.</td>
  268. </tr>
  269. <tr>
  270. <td><font face="Courier New, Courier, mono" size="-1">SFixed16_48</font></td>
  271. <td>signed</td>
  272. <td>64</td>
  273. <td>16 bits of integer, 48 bits of fraction.</td>
  274. </tr>
  275. <tr>
  276. <td><font face="Courier New, Courier, mono" size="-1">UFixed16_48</font></td>
  277. <td>unsigned</td>
  278. <td>64</td>
  279. <td>16 bits of integer, 48 bits of fraction.</td>
  280. </tr>
  281. </table>
  282. <h2>Example usage </h2>
  283. <p>To a large degree, you can use fixed point types the same way you would use
  284. floating point types. </p>
  285. <p>Mixed integer math expressions (same as shown earlier above):</p>
  286. <pre class="code-example">SFixed16_16 a(1), b(2), c(3);<br>float f(4.5f);<br>double d(3.2);<br>int i(6);
  287. <br>a = b * f;<br>a = (c / d) + b + f;<br>a = c / d * (b % i) + f / c;<br>a = i * -c / (b++);<br>a = sin(a) + pow(b, d) * sqrt(a);<br>a = log(a) / log(f);</pre>
  288. <p>printf:</p>
  289. <pre class="code-example">SFixed24_8 f = 23.5f;<br><br>printf(&quot;%f&quot;, f.AsFloat());</pre>
  290. <p>Logical expresions:</p>
  291. <pre class="code-example">SFixed16_16 a = 20.4;
  292. SFixed16_16 b = 130.6;
  293. SFixed16_16 c = 223.3;
  294. if((a &lt; b) || (b &gt;= c) || (a &lt; 23.5))
  295. a *= 25;</pre>
  296. <h2>Limitations </h2>
  297. <p>The primary differences between our fixed point type and a hypothetical built-in
  298. version are:</p>
  299. <ul>
  300. <li>EAFixedPoint doesn't implement cast operators. Instead, provides explicit
  301. converters such as AsInt, AsFloat, etc. This is by design, as such casting
  302. operators result in ambiguous conversions and would need built-in compiler
  303. knowledge to resolve the situation.</li>
  304. <li>Standard library functions such as sprintf have no support for such fixed
  305. point types. However, most of the time it is sufficient to convert to floating
  306. point and use the built-in floating point formatting functions.</li>
  307. <li>There is no explicit support for mixing expressions between two different
  308. fixed point types, such as SFixed16_16 with SFixed24_8. You can use these
  309. together via conversion between built-in types. </li>
  310. </ul>
  311. <h2>Interface </h2>
  312. <p>C interface:</p>
  313. <pre class="code-example">typedef int32_t EAFixed16;
  314. #define EAMAX_FIXED16 0x7fffffff
  315. #define EAMIN_FIXED16 0x80000000
  316. #define EAFixed16ToInt(a) ((int32_t)(a) >> 16)
  317. #define EAIntToFixed16(a) ((EAFixed16)((a) << 16))
  318. #define EAFixed16ToDouble(a) (((double)a) / 65536.0)
  319. #define EADoubleToFixed16(a) ((EAFixed16)((a) * 65536.0))
  320. #define EAFixed16ToFloat(a) (((float)a) / 65536.f)
  321. #define EAFloatToFixed16(a) ((EAFixed16)((a) * 65536.f))
  322. #define EAFixed16Negate(a) (-a)
  323. EAFixed16 EAFixed16Mul (EAFixed16 a, EAFixed16 b);
  324. EAFixed16 EAFixed16Div (EAFixed16 a, EAFixed16 b);
  325. EAFixed16 EAFixed16DivSafe (EAFixed16 a, EAFixed16 b);
  326. EAFixed16 EAFixed16MulDiv (EAFixed16 a, EAFixed16 b, EAFixed16 c);
  327. EAFixed16 EAFixed16MulDivSafe (EAFixed16 a, EAFixed16 b, EAFixed16 c);
  328. EAFixed16 EAFixed16Mod (EAFixed16 a, EAFixed16 b);
  329. EAFixed16 EAFixed16ModSafe (EAFixed16 a, EAFixed16 b);
  330. EAFixed16 EAFixed16Abs (EAFixed16 a);
  331. </pre>
  332. <p>C++ interface, by example of SFixed16_16. Note that nearly all the functions
  333. below are implemented as simple inlines:</p>
  334. <pre class="code-example">struct SFixed16_16
  335. {
  336. SFixed16_16();
  337. SFixed16_16(const SFixed16_16&amp; value);
  338. SFixed16_16(const int&amp; value);
  339. SFixed16_16(const unsigned int&amp; value);
  340. SFixed16_16(const long&amp; value);
  341. SFixed16_16(const unsigned long&amp; value);
  342. SFixed16_16(const float&amp; value);
  343. SFixed16_16(const double&amp; value);
  344. void FromFixed(const int&amp; value);
  345. int32_t AsFixed();
  346. int AsInt() const;
  347. unsigned int AsUnsignedInt() const;
  348. long AsLong() const;
  349. unsigned long AsUnsignedLong()const;
  350. float AsFloat() const;
  351. double AsDouble() const;
  352. SFixed16_16&amp; operator=(const SFixed16_16&amp; value);
  353. SFixed16_16&amp; operator=(const int&amp; value);
  354. SFixed16_16&amp; operator=(const unsigned int&amp; value);
  355. SFixed16_16&amp; operator=(const long&amp; value);
  356. SFixed16_16&amp; operator=(const unsigned long&amp; value);
  357. SFixed16_16&amp; operator=(const float&amp; value);
  358. SFixed16_16&amp; operator=(const double&amp; value);
  359. bool operator&lt; (const SFixed16_16&amp; value) const;
  360. bool operator&gt; (const SFixed16_16&amp; value) const;
  361. bool operator&gt;=(const SFixed16_16&amp; value) const;
  362. bool operator&lt;=(const SFixed16_16&amp; value) const;
  363. bool operator==(const SFixed16_16&amp; value) const;
  364. bool operator!=(const SFixed16_16&amp; value) const;
  365. bool operator&lt; (const int&amp; value) const;
  366. bool operator&gt; (const int&amp; value) const;
  367. bool operator&gt;=(const int&amp; value) const;
  368. bool operator&lt;=(const int&amp; value) const;
  369. bool operator==(const int&amp; value) const;
  370. bool operator!=(const int&amp; value) const;
  371. bool operator&lt; (const unsigned int&amp; value) const;
  372. bool operator&gt; (const unsigned int&amp; value) const;
  373. bool operator&gt;=(const unsigned int&amp; value) const;
  374. bool operator&lt;=(const unsigned int&amp; value) const;
  375. bool operator==(const unsigned int&amp; value) const;
  376. bool operator!=(const unsigned int&amp; value) const;
  377. bool operator&lt; (const long&amp; value) const;
  378. bool operator&gt; (const long&amp; value) const;
  379. bool operator&gt;=(const long&amp; value) const;
  380. bool operator&lt;=(const long&amp; value) const;
  381. bool operator==(const long&amp; value) const;
  382. bool operator!=(const long&amp; value) const;
  383. bool operator&lt; (const unsigned long&amp; value) const;
  384. bool operator&gt; (const unsigned long&amp; value) const;
  385. bool operator&gt;=(const unsigned long&amp; value) const;
  386. bool operator&lt;=(const unsigned long&amp; value) const;
  387. bool operator==(const unsigned long&amp; value) const;
  388. bool operator!=(const unsigned long&amp; value) const;
  389. bool operator&lt; (const float&amp; value) const;
  390. bool operator&gt; (const float&amp; value) const;
  391. bool operator&gt;=(const float&amp; value) const;
  392. bool operator&lt;=(const float&amp; value) const;
  393. bool operator==(const float&amp; value) const;
  394. bool operator!=(const float&amp; value) const;
  395. bool operator&lt; (const double&amp; value) const;
  396. bool operator&gt; (const double&amp; value) const;
  397. bool operator&gt;=(const double&amp; value) const;
  398. bool operator&lt;=(const double&amp; value) const;
  399. bool operator==(const double&amp; value) const;
  400. bool operator!=(const double&amp; value) const;
  401. bool operator! () const;
  402. SFixed16_16 operator~() const;
  403. SFixed16_16 operator-() const;
  404. SFixed16_16 operator+() const;
  405. SFixed16_16&amp; operator+=(const SFixed16_16&amp; value);
  406. SFixed16_16&amp; operator+=(const int&amp; value);
  407. SFixed16_16&amp; operator+=(const unsigned int&amp; value);
  408. SFixed16_16&amp; operator+=(const long &amp; value);
  409. SFixed16_16&amp; operator+=(const unsigned long&amp; value);
  410. SFixed16_16&amp; operator+=(const float&amp; value);
  411. SFixed16_16&amp; operator+=(const double&amp; value);
  412. SFixed16_16&amp; operator-=(const SFixed16_16&amp; value);
  413. SFixed16_16&amp; operator-=(const int&amp; value);
  414. SFixed16_16&amp; operator-=(const unsigned int&amp; value);
  415. SFixed16_16&amp; operator-=(const long&amp; value);
  416. SFixed16_16&amp; operator-=(const unsigned long&amp; value);
  417. SFixed16_16&amp; operator-=(const float&amp; value);
  418. SFixed16_16&amp; operator-=(const double&amp; value);
  419. SFixed16_16&amp; operator*=(const SFixed16_16&amp; value);
  420. SFixed16_16&amp; operator*=(const int&amp; value)
  421. SFixed16_16&amp; operator*=(const unsigned int&amp; value)
  422. SFixed16_16&amp; operator*=(const long&amp; value)
  423. SFixed16_16&amp; operator*=(const unsigned long&amp; value);
  424. SFixed16_16&amp; operator*=(const float&amp; value);
  425. SFixed16_16&amp; operator*=(const double&amp; value);
  426. SFixed16_16&amp; operator/=(const SFixed16_16&amp; value);
  427. SFixed16_16&amp; operator/=(const int&amp; value);
  428. SFixed16_16&amp; operator/=(const unsigned int&amp; value);
  429. SFixed16_16&amp; operator/=(const long&amp; value);
  430. SFixed16_16&amp; operator/=(const unsigned long&amp; value);
  431. SFixed16_16&amp; operator/=(const float&amp; value);
  432. SFixed16_16&amp; operator/=(const double&amp; value);
  433. SFixed16_16&amp; operator%=(const SFixed16_16&amp; value);
  434. SFixed16_16&amp; operator%=(const int&amp; value);
  435. SFixed16_16&amp; operator%=(const unsigned int&amp; value);
  436. SFixed16_16&amp; operator%=(const long&amp; value);
  437. SFixed16_16&amp; operator%=(const unsigned long&amp; value);
  438. SFixed16_16&amp; operator%=(const float&amp; value);
  439. SFixed16_16&amp; operator%=(const double&amp; value);
  440. SFixed16_16&amp; operator|=(const SFixed16_16&amp; value);
  441. SFixed16_16&amp; operator|=(const int&amp; value);
  442. SFixed16_16&amp; operator&amp;=(const SFixed16_16&amp; value);
  443. SFixed16_16&amp; operator&amp;=(const int&amp; value);
  444. SFixed16_16&amp; operator^=(const SFixed16_16&amp; value);
  445. SFixed16_16&amp; operator^=(const int&amp; value);
  446. SFixed16_16 operator&lt;&lt;(int numBits) const;
  447. SFixed16_16 operator&gt;&gt;(int numBits) const;
  448. SFixed16_16&amp; operator&lt;&lt;=(int numBits);
  449. SFixed16_16&amp; operator&gt;&gt;=(int numBits);
  450. SFixed16_16&amp; operator++();
  451. SFixed16_16&amp; operator--();
  452. SFixed16_16 operator++(int);
  453. SFixed16_16 operator--(int);
  454. SFixed16_16 Abs();
  455. SFixed16_16 DivSafe(const SFixed16_16&amp; denominator);
  456. SFixed16_16&amp; DivSafeAssign(const SFixed16_16&amp; denominator);
  457. }<font color="#000099">;</font>
  458. </pre>
  459. <hr>
  460. <p><br>
  461. <br>
  462. <br>
  463. <span style="font-family: monospace;">&nbsp;&nbsp; </span><br>
  464. <br>
  465. <br>
  466. <br>
  467. <br>
  468. <br>
  469. <br>
  470. <br>
  471. <br>
  472. <br>
  473. <br>
  474. <br>
  475. <br>
  476. <br>
  477. <br>
  478. <br>
  479. <br>
  480. <br>
  481. <br>
  482. <br>
  483. <br>
  484. <br>
  485. <br>
  486. </p>
  487. </body></html>