-
Notifications
You must be signed in to change notification settings - Fork 0
/
al___conversion_8hpp_source.html
525 lines (523 loc) · 77.2 KB
/
al___conversion_8hpp_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Allolib: al_Conversion.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Allolib
 <span id="projectnumber">1.0</span>
</div>
<div id="projectbrief">C++ Components For Interactive Multimedia</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('al___conversion_8hpp_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">al_Conversion.hpp</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef INCLUDE_AL_CONVERSION_HPP</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define INCLUDE_AL_CONVERSION_HPP</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>  </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">/* Allocore --</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> Multimedia / virtual environment application class library</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"></span> </div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> Copyright (C) 2009. AlloSphere Research Group, Media Arts & Technology, UCSB.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> Copyright (C) 2012. The Regents of the University of California.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> All rights reserved.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"></span> </div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> Redistribution and use in source and binary forms, with or without</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> modification, are permitted provided that the following conditions are met:</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"></span> </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> Redistributions of source code must retain the above copyright notice,</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"></span> </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"></span> </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> Neither the name of the University of California nor the names of its</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> contributors may be used to endorse or promote products derived from</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> this software without specific prior written permission.</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"></span> </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment"> CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment"> POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"></span> </div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"></span> </div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> File description:</span></div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> This is a grab bag of routines for converting between built-in types</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"></span> </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> File author(s):</span></div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"> Lance Putnam, 2010, [email protected]</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">*/</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#include <limits.h></span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="preprocessor">#include <stdio.h></span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#include <string.h></span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#include <cstdint></span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#include <iostream></span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="preprocessor">#include <sstream></span> <span class="comment">/* string conversion */</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="keyword">namespace </span><a class="code" href="namespaceal.html">al</a> {</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="preprocessor">#ifndef UINT32_C</span></div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#define UINT32_C(v) v##UL</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor">#ifndef UINT64_C</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#define UINT64_C(v) v##ULL</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#define CONST_(N, vf, vd) \</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor"> template <class T> \</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor"> struct N; \</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="preprocessor"> template <> \</span></div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="preprocessor"> struct N<float> { \</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor"> operator uint32_t() const { return UINT32_C(vf); } \</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="preprocessor"> }; \</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="preprocessor"> template <> \</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="preprocessor"> struct N<double> { \</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor"> operator uint64_t() const { return UINT64_C(vd); } \</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="preprocessor"> };</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> CONST_(MaskExpo, 0x7F800000,</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  0x7FF0000000000000) <span class="comment">// IEEE-754 floating-point exponent bit mask</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> CONST_(MaskFrac, 0x007FFFFF,</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  0x000FFFFFFFFFFFFF) <span class="comment">// IEEE-754 floating-point fraction bit mask</span></div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> CONST_(MaskSign, 0x80000000,</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  0x8000000000000000) <span class="comment">// IEEE-754 floating-point sign bit mask</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> CONST_(Expo1, 0x3F800000,</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  0x3FF0000000000000) <span class="comment">// IEEE-754 floating-point [1-2) exponent interval</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#undef CONST_</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structal_1_1_twiddle.html"> 86</a></span> <span class="keyword">struct </span><a class="code" href="structal_1_1_twiddle.html">Twiddle</a>;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="structal_1_1_twiddle_3_01float_01_4.html"> 89</a></span> <span class="keyword">struct </span><a class="code" href="structal_1_1_twiddle.html">Twiddle</a><float> {</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="structal_1_1_twiddle.html">Twiddle</a>(<span class="keyword">const</span> <span class="keywordtype">float</span>& v) : f(v) {}</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="structal_1_1_twiddle.html">Twiddle</a>(<span class="keyword">const</span> uint32_t& v) : u(v) {}</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="structal_1_1_twiddle.html">Twiddle</a>(<span class="keyword">const</span> int32_t& v) : i(v) {}</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">union </span>{</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  int32_t i;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  uint32_t u;</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordtype">float</span> f;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  };</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> };</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  </div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="structal_1_1_twiddle_3_01double_01_4.html"> 101</a></span> <span class="keyword">struct </span><a class="code" href="structal_1_1_twiddle.html">Twiddle</a><double> {</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <a class="code" href="structal_1_1_twiddle.html">Twiddle</a>(<span class="keyword">const</span> <span class="keywordtype">double</span>& v) : f(v) {}</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <a class="code" href="structal_1_1_twiddle.html">Twiddle</a>(<span class="keyword">const</span> uint64_t& v) : u(v) {}</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <a class="code" href="structal_1_1_twiddle.html">Twiddle</a>(<span class="keyword">const</span> int64_t& v) : i(v) {}</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">union </span>{</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  int64_t i;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  uint64_t u;</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordtype">double</span> f;</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  };</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> };</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  </div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="keywordtype">char</span> <a class="code" href="namespaceal.html#a4d3f0876b1eba127cba9d7c26ac4af95">base10To36</a>(<span class="keywordtype">int</span> dec10);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  </div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="keywordtype">int</span> <a class="code" href="namespaceal.html#a15adb71971fe1a7b8b63d5bb0e6932c2">base36To10</a>(<span class="keywordtype">char</span> ascii36);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> uint32_t <a class="code" href="namespaceal.html#a2a73b8667b6327be9fc8cb33e0372b87">bitsToUInt</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* strBin);</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  </div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a3d377bcc9eac6e30016908ad17e6f76d">blockSubnormal</a>(<span class="keywordtype">float</span> v);</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  </div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="keywordtype">double</span> <a class="code" href="namespaceal.html#a3d377bcc9eac6e30016908ad17e6f76d">blockSubnormal</a>(<span class="keywordtype">double</span> v);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  </div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="namespaceal.html#a3a29d117f828e88f154aeae3e0fdc1b7"> 136</a></span> T <a class="code" href="namespaceal.html#a3a29d117f828e88f154aeae3e0fdc1b7">clone</a>(<span class="keyword">const</span> T& obj) {</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">return</span> T(obj);</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> }</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  </div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="keywordtype">int</span> <a class="code" href="namespaceal.html#a33cffc49b723668207d1f775cde2fa97">endian</a>();</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  </div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span> uint32_t <a class="code" href="namespaceal.html#a0ab9cc1e2e93dcb2dff6e272b533f545">floatExponent</a>(<span class="keywordtype">float</span> v);</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  </div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a2f648af5b76f2e432dccd1659ef56065">floatMantissa</a>(<span class="keywordtype">float</span> v);</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  </div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a4a73504c6c93789a16baaf8fdc3012c2">fraction</a>(uint32_t bits, uint32_t phase);</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  </div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#aa3313a97716b1c8d7b50d32ab89f8b25">intToUnit</a>(int16_t v);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  </div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  </div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f"> 166</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(uint32_t v) {</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <a class="code" href="structal_1_1_twiddle_3_01float_01_4.html">Twiddle<float></a> u(v);</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  <span class="keywordflow">return</span> u.f;</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span> }</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  </div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  </div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="line" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180"> 175</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <a class="code" href="structal_1_1_twiddle_3_01float_01_4.html">Twiddle<float></a> u(v);</div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordflow">return</span> u.u;</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span> }</div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  </div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="namespaceal.html#aa86441bf5e21167c03f006403cf88f35"> 181</a></span> <span class="keyword">inline</span> int32_t <a class="code" href="namespaceal.html#aa86441bf5e21167c03f006403cf88f35">punFI</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <a class="code" href="structal_1_1_twiddle_3_01float_01_4.html">Twiddle<float></a> u(v);</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">return</span> u.i;</div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span> }</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  </div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="namespaceal.html#a043f155454288a51d30b3b2bf107c53f"> 187</a></span> <span class="keyword">inline</span> uint64_t <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(<span class="keywordtype">double</span> v) {</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="structal_1_1_twiddle_3_01double_01_4.html">Twiddle<double></a> u(v);</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="keywordflow">return</span> u.u;</div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span> }</div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  </div>
<div class="line"><a name="l00193"></a><span class="lineno"><a class="line" href="namespaceal.html#a012bf2cd5492704a9f1847022316d1a8"> 193</a></span> <span class="keyword">inline</span> int64_t <a class="code" href="namespaceal.html#aa86441bf5e21167c03f006403cf88f35">punFI</a>(<span class="keywordtype">double</span> v) {</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <a class="code" href="structal_1_1_twiddle_3_01double_01_4.html">Twiddle<double></a> u(v);</div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keywordflow">return</span> u.i;</div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span> }</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  </div>
<div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="namespaceal.html#ac0cef01bccd9eec77ac26cfa314fd900"> 199</a></span> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(uint64_t v) {</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <a class="code" href="structal_1_1_twiddle_3_01double_01_4.html">Twiddle<double></a> u(v);</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordflow">return</span> u.f;</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span> }</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  </div>
<div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="namespaceal.html#aecbdb6c596b997bba2fc440dee50b1a6"> 205</a></span> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespaceal.html#aecbdb6c596b997bba2fc440dee50b1a6">punIF</a>(int64_t v) {</div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <a class="code" href="structal_1_1_twiddle_3_01double_01_4.html">Twiddle<double></a> u(v);</div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">return</span> u.f;</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span> }</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  </div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="keywordtype">void</span> <a class="code" href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61">swapBytes</a>(T& word);</div>
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  </div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span> <span class="keywordtype">void</span> <a class="code" href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61">swapBytes</a>(T* data, <span class="keywordtype">unsigned</span> count);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  </div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span> std::string <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* fmt, <span class="keyword">const</span> T& v);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  </div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span> std::string <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(<span class="keyword">const</span> T& v);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span> std::string <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(<span class="keyword">const</span> T* v, <span class="keywordtype">int</span> num, <span class="keywordtype">int</span> stride = 1);</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  </div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00232"></a><span class="lineno"><a class="line" href="namespaceal.html#a9139a7b7af05ce252a53989ee61baa7d"> 232</a></span> T <a class="code" href="namespaceal.html#a9139a7b7af05ce252a53989ee61baa7d">uintToUnit</a>(uint32_t v);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00236"></a><span class="lineno"><a class="line" href="namespaceal.html#a6e9299b7742a9db44ba0b3a885e9a6ea"> 236</a></span> T <a class="code" href="namespaceal.html#a6e9299b7742a9db44ba0b3a885e9a6ea">uintToUnitS</a>(uint32_t v);</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  </div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span> int16_t <a class="code" href="namespaceal.html#a1f9f37cf9b1af4bafbd30be91c9e5e72">unitToInt16</a>(<span class="keywordtype">float</span> v);</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  </div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  </div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span> uint32_t <a class="code" href="namespaceal.html#a604c51f2a59f192757df7c8407c657c5">unitToUInt</a>(<span class="keywordtype">float</span> u);</div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  </div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  </div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span> uint32_t <a class="code" href="namespaceal.html#a7a0edcf75b4ae53eb60f703a23450fa7">unitToUInt2</a>(<span class="keywordtype">float</span> u);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  </div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span> uint8_t <a class="code" href="namespaceal.html#abc3d7cabf83b6acf8eac6d42d8ad263c">unitToUInt8</a>(<span class="keywordtype">float</span> u);</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  </div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span> <span class="comment">// Implementation</span></div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="comment">//------------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  </div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="line" href="namespaceal.html#a4d3f0876b1eba127cba9d7c26ac4af95"> 260</a></span> <span class="keyword">inline</span> <span class="keywordtype">char</span> <a class="code" href="namespaceal.html#a4d3f0876b1eba127cba9d7c26ac4af95">base10To36</a>(<span class="keywordtype">int</span> v) {</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* c = <span class="stringliteral">"0123456789abcdefghijklmnopqrstuvwxyz"</span>;</div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <span class="keywordflow">if</span> (v >= 0 && v <= 35) <span class="keywordflow">return</span> c[v];</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordflow">return</span> <span class="charliteral">'0'</span>;</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span> }</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  </div>
<div class="line"><a name="l00266"></a><span class="lineno"><a class="line" href="namespaceal.html#a15adb71971fe1a7b8b63d5bb0e6932c2"> 266</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceal.html#a15adb71971fe1a7b8b63d5bb0e6932c2">base36To10</a>(<span class="keywordtype">char</span> v) {</div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  v = tolower(v);</div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordflow">if</span> (v >= <span class="charliteral">'0'</span> && v <= <span class="charliteral">'9'</span>) <span class="keywordflow">return</span> v - <span class="charliteral">'0'</span>;</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordflow">if</span> (v >= <span class="charliteral">'a'</span> && v <= <span class="charliteral">'z'</span>) <span class="keywordflow">return</span> v - <span class="charliteral">'a'</span> + 10;</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="keywordflow">return</span> 0; <span class="comment">// non-alphanumeric</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span> }</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  </div>
<div class="line"><a name="l00273"></a><span class="lineno"><a class="line" href="namespaceal.html#a2a73b8667b6327be9fc8cb33e0372b87"> 273</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="namespaceal.html#a2a73b8667b6327be9fc8cb33e0372b87">bitsToUInt</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keywordtype">string</span>) {</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  uint32_t v = 0;</div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordtype">size_t</span> n = strlen(<span class="keywordtype">string</span>);</div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < n; ++i)</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">if</span> (<span class="keywordtype">string</span>[i] == <span class="charliteral">'1'</span>) v |= 1 << (n - 1 - i);</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="keywordflow">return</span> v;</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span> }</div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  </div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span> <span class="comment">// alternate version...</span></div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span> <span class="comment">// inline uint32_t bitsToUInt(const char * bits){</span></div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span> <span class="comment">// uint32_t i=0, r=0;</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span> <span class="comment">// for(; bits[i] && i<32; ++i) r |= ((bits[i]=='1'?1:0) << (31-i));</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span> <span class="comment">// return r>>(32-i);</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span> <span class="comment">//}</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  </div>
<div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="namespaceal.html#a3d377bcc9eac6e30016908ad17e6f76d"> 289</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a3d377bcc9eac6e30016908ad17e6f76d">blockSubnormal</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  <span class="keyword">const</span> uint32_t i = <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(v);</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  <span class="keyword">const</span> uint32_t frac = i & MaskFrac<float>();</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  <span class="keyword">const</span> uint32_t expo = i & MaskExpo<float>();</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keywordflow">if</span> (expo == 0 && frac != 0) v = 0.f;</div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  <span class="keywordflow">return</span> v;</div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span> }</div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  </div>
<div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="namespaceal.html#af8c9e3e75ee0e5239f1edddbcc352673"> 298</a></span> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespaceal.html#a3d377bcc9eac6e30016908ad17e6f76d">blockSubnormal</a>(<span class="keywordtype">double</span> v) {</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keyword">const</span> uint64_t i = <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(v);</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keyword">const</span> uint64_t frac = i & MaskFrac<double>();</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keyword">const</span> uint64_t expo = i & MaskExpo<double>();</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordflow">if</span> (expo == 0 && frac != 0) v = 0.;</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="keywordflow">return</span> v;</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> }</div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  </div>
<div class="line"><a name="l00306"></a><span class="lineno"><a class="line" href="namespaceal.html#a33cffc49b723668207d1f775cde2fa97"> 306</a></span> <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceal.html#a33cffc49b723668207d1f775cde2fa97">endian</a>() {</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="keyword">static</span> <span class="keywordtype">int</span> x = 1;</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keywordflow">return</span> *(<span class="keywordtype">char</span>*)&x;</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span> }</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  </div>
<div class="line"><a name="l00311"></a><span class="lineno"><a class="line" href="namespaceal.html#a0ab9cc1e2e93dcb2dff6e272b533f545"> 311</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="namespaceal.html#a0ab9cc1e2e93dcb2dff6e272b533f545">floatExponent</a>(<span class="keywordtype">float</span> v) { <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(v) >> 23 & 0xff; }</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  </div>
<div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="namespaceal.html#a2f648af5b76f2e432dccd1659ef56065"> 313</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a2f648af5b76f2e432dccd1659ef56065">floatMantissa</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  uint32_t frac = <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(v);</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  frac = (frac & MaskFrac<float>()) | Expo1<float>();</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(frac) - 1.f;</div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span> }</div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  </div>
<div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="namespaceal.html#a4a73504c6c93789a16baaf8fdc3012c2"> 319</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#a4a73504c6c93789a16baaf8fdc3012c2">fraction</a>(uint32_t bits, uint32_t phase) {</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  phase = phase << bits >> 9 | Expo1<float>();</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(phase) - 1.f;</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span> }</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  </div>
<div class="line"><a name="l00324"></a><span class="lineno"><a class="line" href="namespaceal.html#aa3313a97716b1c8d7b50d32ab89f8b25"> 324</a></span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="namespaceal.html#aa3313a97716b1c8d7b50d32ab89f8b25">intToUnit</a>(int16_t v) {</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  uint32_t vu = (((uint32_t)v) + 0x808000)</div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  << 7; <span class="comment">// set fraction in float [2, 4)</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(vu) - 3.f;</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span> }</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  </div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span> <span class="comment">// This is used by swapBytes</span></div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span> <span class="keyword">template</span> <<span class="keywordtype">int</span> NumBytes></div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span> <span class="keywordtype">void</span> swapBytesN(<span class="keywordtype">void</span>* word);</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  </div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> swapBytesN<1>(<span class="keywordtype">void</span>* word) {}</div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  </div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> swapBytesN<2>(<span class="keywordtype">void</span>* word) {</div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  uint16_t& v = *(uint16_t*)word;</div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  v = (v >> 8) | (v << 8);</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span> }</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  </div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> swapBytesN<3>(<span class="keywordtype">void</span>* word) {</div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  uint8_t* v = (uint8_t*)word;</div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  v[0] ^= v[2];</div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  v[2] ^= v[0];</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  v[0] ^= v[2];</div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span> }</div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  </div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> swapBytesN<4>(<span class="keywordtype">void</span>* word) {</div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  uint32_t& v = *(uint32_t*)word;</div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  v = ((v >> 24)) | ((v >> 8) & 0x0000ff00UL) | ((v << 8) & 0x00ff0000UL) |</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  ((v << 24));</div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span> }</div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  </div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> swapBytesN<8>(<span class="keywordtype">void</span>* word) {</div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  uint64_t& v = *(uint64_t*)word;</div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  v = ((v >> 56)) | ((v >> 40) & 0x000000000000ff00ULL) |</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  ((v >> 24) & 0x0000000000ff0000ULL) | ((v >> 8) & 0x00000000ff000000ULL) |</div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  ((v << 8) & 0x000000ff00000000ULL) | ((v << 24) & 0x0000ff0000000000ULL) |</div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  ((v << 40) & 0x00ff000000000000ULL) | ((v << 56));</div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span> }</div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  </div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div>
<div class="line"><a name="l00368"></a><span class="lineno"><a class="line" href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61"> 368</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61">swapBytes</a>(T& v) {</div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  swapBytesN<sizeof(v)>(&v);</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> }</div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  </div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="namespaceal.html#aad6804a0d4cd377eabcfd6c1ec328aed"> 373</a></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61">swapBytes</a>(T* data, <span class="keywordtype">unsigned</span> count) {</div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i < count; ++i) <a class="code" href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61">swapBytes</a>(data[i]);</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span> }</div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  </div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00378"></a><span class="lineno"><a class="line" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333"> 378</a></span> std::string <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* fmt, <span class="keyword">const</span> T& v) {</div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordtype">char</span> buf[32];</div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  snprintf(buf, <span class="keyword">sizeof</span>(buf), fmt, v);</div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="keywordflow">return</span> std::string(buf);</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span> }</div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  </div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00385"></a><span class="lineno"><a class="line" href="namespaceal.html#a150d87ec5d084382893c987867fd05bd"> 385</a></span> std::string <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(<span class="keyword">const</span> T* v, <span class="keywordtype">int</span> n, <span class="keywordtype">int</span> s) {</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  std::string r;</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < n; ++i) {</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  r += <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(v[i * s]);</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordflow">if</span> (i < (n - 1)) r += <span class="stringliteral">", "</span>;</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  }</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  <span class="keywordflow">return</span> r;</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span> }</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  </div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div>
<div class="line"><a name="l00395"></a><span class="lineno"><a class="line" href="namespaceal.html#a85b93a7a4c2f548898c8f7d2f33fe7c6"> 395</a></span> std::string <a class="code" href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">toString</a>(<span class="keyword">const</span> T& v) {</div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="keyword">using namespace </span>std;</div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  stringstream ss(stringstream::in | stringstream::out);</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  ss << v;</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="keywordtype">string</span> r;</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  ss >> r;</div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="keywordflow">return</span> r;</div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span> }</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  </div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> uintToUnit<float>(uint32_t v) {</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  v = v >> 9 | Expo1<float>(); <span class="comment">// float in [1, 2)</span></div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(v) - 1.f;</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span> }</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  </div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span> <span class="keyword">template</span> <></div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> uintToUnitS<float>(uint32_t v) {</div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  v = v >> 9 | 0x40000000; <span class="comment">// float in [2, 4)</span></div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">punUF</a>(v) - 3.f;</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span> }</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  </div>
<div class="line"><a name="l00416"></a><span class="lineno"><a class="line" href="namespaceal.html#a1f9f37cf9b1af4bafbd30be91c9e5e72"> 416</a></span> <span class="keyword">inline</span> int16_t <a class="code" href="namespaceal.html#a1f9f37cf9b1af4bafbd30be91c9e5e72">unitToInt16</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="keywordtype">float</span> r = v + 3.f; <span class="comment">// put in [2,4)</span></div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordflow">return</span> int16_t((<a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">al::punFU</a>(r) >> 7) + (1 << 15));</div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span> }</div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  </div>
<div class="line"><a name="l00421"></a><span class="lineno"><a class="line" href="namespaceal.html#a604c51f2a59f192757df7c8407c657c5"> 421</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="namespaceal.html#a604c51f2a59f192757df7c8407c657c5">unitToUInt</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  ++v; <span class="comment">// go into [1,2] range, FP fraction is now result</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  <span class="keywordflow">return</span> <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(v) << 9;</div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span> }</div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  </div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span> <span class="comment">// TODO: make 64-bit ready</span></div>
<div class="line"><a name="l00427"></a><span class="lineno"><a class="line" href="namespaceal.html#a7a0edcf75b4ae53eb60f703a23450fa7"> 427</a></span> <span class="keyword">inline</span> uint32_t <a class="code" href="namespaceal.html#a7a0edcf75b4ae53eb60f703a23450fa7">unitToUInt2</a>(<span class="keywordtype">float</span> v) {</div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  uint32_t normalU = <a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(v);</div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  uint32_t rbs = 126UL - (normalU >> 23UL);</div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="comment">// printf("%x %lu\n", (normalU | 0x800000) << 8, rbs);</span></div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <span class="comment">// printf("%x\n", 0x80000000UL >> rbs);</span></div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="keywordflow">return</span> (((normalU | 0x800000UL) << 8UL) & (~ULONG_MAX | 0xffffffffUL)) >> rbs;</div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  </div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  <span class="comment">// uint32_t normalU = punFU(v);</span></div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="comment">// uint32_t rbs = 118UL - ((normalU >> 23UL) & (~ULONG_MAX | 0x7fffffUL));</span></div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span> <span class="comment"></span> <span class="comment">// return ((normalU & (~ULONG_MAX | 0xffffffUL)) | 0x800000UL) >> rbs;</span></div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span> <span class="comment"></span> </div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <span class="comment">// Her00</span></div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <span class="comment">// float y = v + 1.f;</span></div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="comment">// return ((unsigned long&)v) & 0x7FFFFF; // last 23 bits</span></div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span> }</div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  </div>
<div class="line"><a name="l00447"></a><span class="lineno"><a class="line" href="namespaceal.html#abc3d7cabf83b6acf8eac6d42d8ad263c"> 447</a></span> <span class="keyword">inline</span> uint8_t <a class="code" href="namespaceal.html#abc3d7cabf83b6acf8eac6d42d8ad263c">unitToUInt8</a>(<span class="keywordtype">float</span> u) {</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  ++u;</div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <span class="keywordflow">return</span> (<a class="code" href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">punFU</a>(u) >> 15) & MaskFrac<float>();</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span> }</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  </div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span> } <span class="comment">// namespace al</span></div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  </div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span> <span class="preprocessor">#endif</span></div>
<div class="ttc" id="anamespaceal_html"><div class="ttname"><a href="namespaceal.html">al</a></div><div class="ttdef"><b>Definition:</b> <a href="al___app_8hpp_source.html#l00023">al_App.hpp:23</a></div></div>
<div class="ttc" id="anamespaceal_html_a0ab9cc1e2e93dcb2dff6e272b533f545"><div class="ttname"><a href="namespaceal.html#a0ab9cc1e2e93dcb2dff6e272b533f545">al::floatExponent</a></div><div class="ttdeci">uint32_t floatExponent(float v)</div><div class="ttdoc">Returns biased decimal value of 32-bit float exponent field.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00311">al_Conversion.hpp:311</a></div></div>
<div class="ttc" id="anamespaceal_html_a150618c9feacbf56a7da03bbc2042180"><div class="ttname"><a href="namespaceal.html#a150618c9feacbf56a7da03bbc2042180">al::punFU</a></div><div class="ttdeci">uint32_t punFU(float v)</div><div class="ttdoc">Type-pun 32-bit float to 32-bit unsigned int.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00175">al_Conversion.hpp:175</a></div></div>
<div class="ttc" id="anamespaceal_html_a15adb71971fe1a7b8b63d5bb0e6932c2"><div class="ttname"><a href="namespaceal.html#a15adb71971fe1a7b8b63d5bb0e6932c2">al::base36To10</a></div><div class="ttdeci">int base36To10(char ascii36)</div><div class="ttdoc">Convert ascii base-36 character to decimal integer.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00266">al_Conversion.hpp:266</a></div></div>
<div class="ttc" id="anamespaceal_html_a1f9f37cf9b1af4bafbd30be91c9e5e72"><div class="ttname"><a href="namespaceal.html#a1f9f37cf9b1af4bafbd30be91c9e5e72">al::unitToInt16</a></div><div class="ttdeci">int16_t unitToInt16(float v)</div><div class="ttdoc">Convert float in [-1, 1) to 16-bit signed int in [0, 2^16)</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00416">al_Conversion.hpp:416</a></div></div>
<div class="ttc" id="anamespaceal_html_a2a73b8667b6327be9fc8cb33e0372b87"><div class="ttname"><a href="namespaceal.html#a2a73b8667b6327be9fc8cb33e0372b87">al::bitsToUInt</a></div><div class="ttdeci">uint32_t bitsToUInt(const char *strBin)</div><div class="ttdoc">Convert a string of 1s and 0s to an integer.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00273">al_Conversion.hpp:273</a></div></div>
<div class="ttc" id="anamespaceal_html_a2f648af5b76f2e432dccd1659ef56065"><div class="ttname"><a href="namespaceal.html#a2f648af5b76f2e432dccd1659ef56065">al::floatMantissa</a></div><div class="ttdeci">float floatMantissa(float v)</div><div class="ttdoc">Returns mantissa field as float between [0, 1).</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00313">al_Conversion.hpp:313</a></div></div>
<div class="ttc" id="anamespaceal_html_a2fa7004b3f65e67269c82e2d97ec0d5f"><div class="ttname"><a href="namespaceal.html#a2fa7004b3f65e67269c82e2d97ec0d5f">al::punUF</a></div><div class="ttdeci">float punUF(uint32_t v)</div><div class="ttdoc">Type-pun 32-bit unsigned int to 32-bit float.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00166">al_Conversion.hpp:166</a></div></div>
<div class="ttc" id="anamespaceal_html_a33cffc49b723668207d1f775cde2fa97"><div class="ttname"><a href="namespaceal.html#a33cffc49b723668207d1f775cde2fa97">al::endian</a></div><div class="ttdeci">int endian()</div><div class="ttdoc">Returns 1 if little endian, 0 if big endian.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00306">al_Conversion.hpp:306</a></div></div>
<div class="ttc" id="anamespaceal_html_a3a29d117f828e88f154aeae3e0fdc1b7"><div class="ttname"><a href="namespaceal.html#a3a29d117f828e88f154aeae3e0fdc1b7">al::clone</a></div><div class="ttdeci">T clone(const T &obj)</div><div class="ttdoc">Returns temporary copy-constructed object.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00136">al_Conversion.hpp:136</a></div></div>
<div class="ttc" id="anamespaceal_html_a3d377bcc9eac6e30016908ad17e6f76d"><div class="ttname"><a href="namespaceal.html#a3d377bcc9eac6e30016908ad17e6f76d">al::blockSubnormal</a></div><div class="ttdeci">float blockSubnormal(float v)</div><div class="ttdoc">Returns zero if argument is subnormal, otherwise returns argument.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00289">al_Conversion.hpp:289</a></div></div>
<div class="ttc" id="anamespaceal_html_a4a73504c6c93789a16baaf8fdc3012c2"><div class="ttname"><a href="namespaceal.html#a4a73504c6c93789a16baaf8fdc3012c2">al::fraction</a></div><div class="ttdeci">float fraction(uint32_t bits, uint32_t phase)</div><div class="ttdoc">Converts linear integer phase to fraction.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00319">al_Conversion.hpp:319</a></div></div>
<div class="ttc" id="anamespaceal_html_a4d3f0876b1eba127cba9d7c26ac4af95"><div class="ttname"><a href="namespaceal.html#a4d3f0876b1eba127cba9d7c26ac4af95">al::base10To36</a></div><div class="ttdeci">char base10To36(int dec10)</div><div class="ttdoc">Convert decimal integer to ascii base-36 character.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00260">al_Conversion.hpp:260</a></div></div>
<div class="ttc" id="anamespaceal_html_a604c51f2a59f192757df7c8407c657c5"><div class="ttname"><a href="namespaceal.html#a604c51f2a59f192757df7c8407c657c5">al::unitToUInt</a></div><div class="ttdeci">uint32_t unitToUInt(float u)</div><div class="ttdoc">Convert float in [0, 1) to 32-bit unsigned int in [0, 2^32)</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00421">al_Conversion.hpp:421</a></div></div>
<div class="ttc" id="anamespaceal_html_a6e9299b7742a9db44ba0b3a885e9a6ea"><div class="ttname"><a href="namespaceal.html#a6e9299b7742a9db44ba0b3a885e9a6ea">al::uintToUnitS</a></div><div class="ttdeci">T uintToUnitS(uint32_t v)</div><div class="ttdoc">Convert 32-bit unsigned integer to unit float in [-1, 1)</div></div>
<div class="ttc" id="anamespaceal_html_a7a0edcf75b4ae53eb60f703a23450fa7"><div class="ttname"><a href="namespaceal.html#a7a0edcf75b4ae53eb60f703a23450fa7">al::unitToUInt2</a></div><div class="ttdeci">uint32_t unitToUInt2(float u)</div><div class="ttdoc">Convert float in [0, 1) to 32-bit unsigned int in [0, 2^32)</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00427">al_Conversion.hpp:427</a></div></div>
<div class="ttc" id="anamespaceal_html_a81d5cd81be1c32bd5c1e05212cce8e61"><div class="ttname"><a href="namespaceal.html#a81d5cd81be1c32bd5c1e05212cce8e61">al::swapBytes</a></div><div class="ttdeci">void swapBytes(T &word)</div><div class="ttdoc">Swap the bytes of a word in-place.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00368">al_Conversion.hpp:368</a></div></div>
<div class="ttc" id="anamespaceal_html_a9139a7b7af05ce252a53989ee61baa7d"><div class="ttname"><a href="namespaceal.html#a9139a7b7af05ce252a53989ee61baa7d">al::uintToUnit</a></div><div class="ttdeci">T uintToUnit(uint32_t v)</div><div class="ttdoc">Convert 32-bit unsigned integer to unit float in [0, 1)</div></div>
<div class="ttc" id="anamespaceal_html_aa3313a97716b1c8d7b50d32ab89f8b25"><div class="ttname"><a href="namespaceal.html#aa3313a97716b1c8d7b50d32ab89f8b25">al::intToUnit</a></div><div class="ttdeci">float intToUnit(int16_t v)</div><div class="ttdoc">Convert 16-bit signed integer to floating point in [-1, 1)</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00324">al_Conversion.hpp:324</a></div></div>
<div class="ttc" id="anamespaceal_html_aa86441bf5e21167c03f006403cf88f35"><div class="ttname"><a href="namespaceal.html#aa86441bf5e21167c03f006403cf88f35">al::punFI</a></div><div class="ttdeci">int32_t punFI(float v)</div><div class="ttdoc">Type-pun 32-bit float to 32-bit signed int.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00181">al_Conversion.hpp:181</a></div></div>
<div class="ttc" id="anamespaceal_html_abc3d7cabf83b6acf8eac6d42d8ad263c"><div class="ttname"><a href="namespaceal.html#abc3d7cabf83b6acf8eac6d42d8ad263c">al::unitToUInt8</a></div><div class="ttdeci">uint8_t unitToUInt8(float u)</div><div class="ttdoc">Convert float in [0, 1) to 8-bit unsigned int in [0, 256)</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00447">al_Conversion.hpp:447</a></div></div>
<div class="ttc" id="anamespaceal_html_acd36d6d2100844ebac82a9c7557ae333"><div class="ttname"><a href="namespaceal.html#acd36d6d2100844ebac82a9c7557ae333">al::toString</a></div><div class="ttdeci">std::string toString(const char *fmt, const T &v)</div><div class="ttdoc">Convert argument to a string using snprintf.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00378">al_Conversion.hpp:378</a></div></div>
<div class="ttc" id="anamespaceal_html_aecbdb6c596b997bba2fc440dee50b1a6"><div class="ttname"><a href="namespaceal.html#aecbdb6c596b997bba2fc440dee50b1a6">al::punIF</a></div><div class="ttdeci">double punIF(int64_t v)</div><div class="ttdoc">Type-pun 64-bit signed int to 64-bit float.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00205">al_Conversion.hpp:205</a></div></div>
<div class="ttc" id="astructal_1_1_twiddle_3_01double_01_4_html"><div class="ttname"><a href="structal_1_1_twiddle_3_01double_01_4.html">al::Twiddle< double ></a></div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00101">al_Conversion.hpp:101</a></div></div>
<div class="ttc" id="astructal_1_1_twiddle_3_01float_01_4_html"><div class="ttname"><a href="structal_1_1_twiddle_3_01float_01_4.html">al::Twiddle< float ></a></div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00089">al_Conversion.hpp:89</a></div></div>
<div class="ttc" id="astructal_1_1_twiddle_html"><div class="ttname"><a href="structal_1_1_twiddle.html">al::Twiddle</a></div><div class="ttdoc">Union for twiddling bits of floats.</div><div class="ttdef"><b>Definition:</b> <a href="al___conversion_8hpp_source.html#l00086">al_Conversion.hpp:86</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_e6bb53534ac0e427887cf7a94c0c004e.html">C:</a></li><li class="navelem"><a class="el" href="dir_8ceffd4ee35c3518d4e8bdc7e638efe8.html">Users</a></li><li class="navelem"><a class="el" href="dir_d934af30b392b1c85e577a193a4f44d7.html">Andres</a></li><li class="navelem"><a class="el" href="dir_e68da7aceac684d2d8b9f1b11e1c2d97.html">source</a></li><li class="navelem"><a class="el" href="dir_fcc7705357f5b24b756c781e261be61a.html">repos</a></li><li class="navelem"><a class="el" href="dir_c3c6d9593ff25ad9938aa507653e60f1.html">casm_viewer</a></li><li class="navelem"><a class="el" href="dir_62b775495639e85334a47dd0b350fd78.html">external</a></li><li class="navelem"><a class="el" href="dir_b57b95b4f0b0651157add3c4117135ea.html">tinc</a></li><li class="navelem"><a class="el" href="dir_a51c8fbca25ad649a2e41de73b4ed7a8.html">external</a></li><li class="navelem"><a class="el" href="dir_f6b0d4003da5aa0ecdbed61a62e8b0a3.html">allolib</a></li><li class="navelem"><a class="el" href="dir_1a17cbf7a13c3de19497337dcee9a11d.html">include</a></li><li class="navelem"><a class="el" href="dir_c24702039c85b0e1007cbbfcdd096437.html">al</a></li><li class="navelem"><a class="el" href="dir_7b7c64426413288444074c0e62696c08.html">types</a></li><li class="navelem"><b>al_Conversion.hpp</b></li>
<li class="footer">Generated on Thu Apr 8 2021 13:24:22 for Allolib by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>