This commit is contained in:
manojsdoshi
2020-04-24 01:09:47 +00:00
parent 4ad595bf18
commit 430f6c0cf3
2864 changed files with 304301 additions and 292875 deletions

View File

@@ -94,147 +94,144 @@ $(function() {
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceripple.html">ripple</a> {</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;Quality::Quality (<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> value)</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; : m_value (value)</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;{</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;}</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;Quality::Quality (Amounts <span class="keyword">const</span>&amp; amount)</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; : m_value (<a class="code" href="namespaceripple.html#a73cc988e7ba5d5ee0fd9db53740917ec">getRate</a> (amount.<a class="code" href="namespaceripple.html#a7cc64e12723fbc9606d85442a2569fedac68271a63ddbc431c307beb7d2918275">out</a>, amount.<a class="code" href="namespaceripple.html#a7cc64e12723fbc9606d85442a2569feda13b5bfe96f3e2fe411c9f66f4a582adf">in</a>))</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;{</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;}</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;Quality&amp;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;Quality::operator++()</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;{</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; assert (m_value &gt; 0);</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; --m_value;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;}</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;Quality</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;Quality::operator++ (<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;{</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; Quality <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> (*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; ++*<span class="keyword">this</span>;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; <span class="keywordflow">return</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;}</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;Quality&amp;</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;Quality::operator--()</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;{</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; assert (m_value &lt; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits&lt;value_type&gt;::max</a>());</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; ++m_value;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;}</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;Quality</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;Quality::operator-- (<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;{</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; Quality <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a> (*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; --*<span class="keyword">this</span>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">return</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;}</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;Amounts</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;Quality::ceil_in (Amounts <span class="keyword">const</span>&amp; amount, STAmount <span class="keyword">const</span>&amp; limit)<span class="keyword"> const</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">if</span> (amount.in &gt; limit)</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; {</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; Amounts result (limit, <a class="code" href="namespaceripple.html#a47b15adfd6fb69767c64f50d860a11cc">divRound</a> (</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; limit, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a8e8d814b8820ce0b6979abde0d6a2618">rate</a>(), amount.out.issue (), <span class="keyword">true</span>));</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="comment">// Clamp out</span></div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">if</span> (result.out &gt; amount.out)</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; result.out = amount.out;</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; assert (result.in == limit);</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; }</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; assert (amount.in &lt;= limit);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keywordflow">return</span> amount;</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;}</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; </div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;Amounts</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;Quality::ceil_out (Amounts <span class="keyword">const</span>&amp; amount, STAmount <span class="keyword">const</span>&amp; limit)<span class="keyword"> const</span></div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">if</span> (amount.out &gt; limit)</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; {</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; Amounts result (<a class="code" href="namespaceripple.html#a7806e73f2a04df365821602cfcf89ff2">mulRound</a> (</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; limit, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a8e8d814b8820ce0b6979abde0d6a2618">rate</a>(), amount.in.issue (), <span class="keyword">true</span>), limit);</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// Clamp in</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">if</span> (result.in &gt; amount.in)</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; result.in = amount.in;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; assert (result.out == limit);</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; }</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; assert (amount.out &lt;= limit);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="keywordflow">return</span> amount;</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;}</div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;Quality</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="namespaceripple.html#a7c8945b5034bba5f9df719cff2503495"> 103</a></span>&#160;<a class="code" href="namespaceripple.html#a7c8945b5034bba5f9df719cff2503495">composed_quality</a> (Quality <span class="keyword">const</span>&amp; lhs, Quality <span class="keyword">const</span>&amp; rhs)</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;{</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span> lhs_rate (lhs.rate ());</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; assert (lhs_rate != beast::zero);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span> rhs_rate (rhs.rate ());</div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; assert (rhs_rate != beast::zero);</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;Quality::Quality(<a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> value) : m_value(value)</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;}</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;Quality::Quality(Amounts <span class="keyword">const</span>&amp; amount)</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160; : m_value(<a class="code" href="namespaceripple.html#a73cc988e7ba5d5ee0fd9db53740917ec">getRate</a>(amount.<a class="code" href="namespaceripple.html#a7cc64e12723fbc9606d85442a2569fedac68271a63ddbc431c307beb7d2918275">out</a>, amount.<a class="code" href="namespaceripple.html#a7cc64e12723fbc9606d85442a2569feda13b5bfe96f3e2fe411c9f66f4a582adf">in</a>))</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;{</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;}</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;Quality&amp;</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;Quality::operator++()</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;{</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; assert(m_value &gt; 0);</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160; --m_value;</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;}</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;Quality</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;Quality::operator++(<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;{</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; Quality <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; ++*<span class="keyword">this</span>;</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keywordflow">return</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;}</div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;Quality&amp;</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;Quality::operator--()</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;{</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; assert(m_value &lt; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits&lt;value_type&gt;::max</a>());</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; ++m_value;</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;}</div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; </div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;Quality</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;Quality::operator--(<span class="keywordtype">int</span>)</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;{</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; Quality <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; --*<span class="keyword">this</span>;</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordflow">return</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/iterator/prev.html">prev</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;}</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;Amounts</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;Quality::ceil_in(Amounts <span class="keyword">const</span>&amp; amount, STAmount <span class="keyword">const</span>&amp; limit)<span class="keyword"> const</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keywordflow">if</span> (amount.in &gt; limit)</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; {</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; Amounts result(</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; limit, <a class="code" href="namespaceripple.html#a47b15adfd6fb69767c64f50d860a11cc">divRound</a>(limit, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a8e8d814b8820ce0b6979abde0d6a2618">rate</a>(), amount.out.issue(), <span class="keyword">true</span>));</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">// Clamp out</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">if</span> (result.out &gt; amount.out)</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; result.out = amount.out;</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; assert(result.in == limit);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; }</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; assert(amount.in &lt;= limit);</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">return</span> amount;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;}</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;Amounts</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;Quality::ceil_out(Amounts <span class="keyword">const</span>&amp; amount, STAmount <span class="keyword">const</span>&amp; limit)<span class="keyword"> const</span></div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="keywordflow">if</span> (amount.out &gt; limit)</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; {</div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; Amounts result(<a class="code" href="namespaceripple.html#a7806e73f2a04df365821602cfcf89ff2">mulRound</a>(limit, <a class="code" href="namespaceripple_1_1test_1_1jtx.html#a8e8d814b8820ce0b6979abde0d6a2618">rate</a>(), amount.in.issue(), <span class="keyword">true</span>), limit);</div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// Clamp in</span></div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="keywordflow">if</span> (result.in &gt; amount.in)</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; result.in = amount.in;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; assert(result.out == limit);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; }</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; assert(amount.out &lt;= limit);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keywordflow">return</span> amount;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;Quality</div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="namespaceripple.html#a7c8945b5034bba5f9df719cff2503495"> 101</a></span>&#160;<a class="code" href="namespaceripple.html#a7c8945b5034bba5f9df719cff2503495">composed_quality</a>(Quality <span class="keyword">const</span>&amp; lhs, Quality <span class="keyword">const</span>&amp; rhs)</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;{</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span> lhs_rate(lhs.rate());</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; assert(lhs_rate != beast::zero);</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span> rhs_rate(rhs.rate());</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; assert(rhs_rate != beast::zero);</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span> rate(<a class="code" href="namespaceripple.html#a7806e73f2a04df365821602cfcf89ff2">mulRound</a>(lhs_rate, rhs_rate, lhs_rate.<a class="code" href="classripple_1_1STAmount.html#a60d8449d2915fa495f12994f56ceca34">issue</a>(), <span class="keyword">true</span>));</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="code" href="classripple_1_1STAmount.html">STAmount</a> <span class="keyword">const</span> rate (<a class="code" href="namespaceripple.html#a7806e73f2a04df365821602cfcf89ff2">mulRound</a> (</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; lhs_rate, rhs_rate, lhs_rate.<a class="code" href="classripple_1_1STAmount.html#a60d8449d2915fa495f12994f56ceca34">issue</a> (), <span class="keyword">true</span>));</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> <span class="keyword">const</span> stored_exponent(rate.exponent() + 100);</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> <span class="keyword">const</span> stored_mantissa(rate.mantissa());</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> <span class="keyword">const</span> stored_exponent (rate.exponent () + 100);</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> <span class="keyword">const</span> stored_mantissa (rate.mantissa());</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; </div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; assert ((stored_exponent &gt; 0) &amp;&amp; (stored_exponent &lt;= 255));</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; assert((stored_exponent &gt; 0) &amp;&amp; (stored_exponent &lt;= 255));</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordflow">return</span> Quality((stored_exponent &lt;&lt; (64 - 8)) | stored_mantissa);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;}</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">return</span> Quality ((stored_exponent &lt;&lt; (64 - 8)) | stored_mantissa);</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;}</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;Quality</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;Quality::round (<span class="keywordtype">int</span> digits)<span class="keyword"> const</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="comment">// Modulus for mantissa</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> mod[17] = {</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="comment">/* 0 */</span> 10000000000000000,</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">/* 1 */</span> 1000000000000000,</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">/* 2 */</span> 100000000000000,</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">/* 3 */</span> 10000000000000,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">/* 4 */</span> 1000000000000,</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">/* 5 */</span> 100000000000,</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">/* 6 */</span> 10000000000,</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="comment">/* 7 */</span> 1000000000,</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">/* 8 */</span> 100000000,</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">/* 9 */</span> 10000000,</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="comment">/* 10 */</span> 1000000,</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="comment">/* 11 */</span> 100000,</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">/* 12 */</span> 10000,</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="comment">/* 13 */</span> 1000,</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="comment">/* 14 */</span> 100,</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">/* 15 */</span> 10,</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">/* 16 */</span> 1,</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; };</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keyword">auto</span> exponent = m_value &gt;&gt; (64 - 8);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keyword">auto</span> mantissa = m_value &amp; 0x00ffffffffffffffULL;</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; mantissa += mod[digits] - 1;</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; mantissa -= (mantissa % mod[digits]);</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;Quality</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;Quality::round(<span class="keywordtype">int</span> digits)<span class="keyword"> const</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="keyword"></span>{</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; <span class="comment">// Modulus for mantissa</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <a class="codeRef" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a> mod[17] = {</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="comment">/* 0 */</span> 10000000000000000,</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="comment">/* 1 */</span> 1000000000000000,</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="comment">/* 2 */</span> 100000000000000,</div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; <span class="comment">/* 3 */</span> 10000000000000,</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">/* 4 */</span> 1000000000000,</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">/* 5 */</span> 100000000000,</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">/* 6 */</span> 10000000000,</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">/* 7 */</span> 1000000000,</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">/* 8 */</span> 100000000,</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="comment">/* 9 */</span> 10000000,</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="comment">/* 10 */</span> 1000000,</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">/* 11 */</span> 100000,</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="comment">/* 12 */</span> 10000,</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="comment">/* 13 */</span> 1000,</div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="comment">/* 14 */</span> 100,</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">/* 15 */</span> 10,</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="comment">/* 16 */</span> 1,</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; };</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keyword">auto</span> exponent = m_value &gt;&gt; (64 - 8);</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keyword">auto</span> mantissa = m_value &amp; 0x00ffffffffffffffULL;</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; mantissa += mod[digits] - 1;</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; mantissa -= (mantissa % mod[digits]);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">return</span> Quality{(exponent &lt;&lt; (64 - 8)) | mantissa};</div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;}</div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keywordflow">return</span> Quality{(exponent &lt;&lt; (64 - 8)) | mantissa};</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160;}</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; </div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;}</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;} <span class="comment">// namespace ripple</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="anamespaceripple_html_a7c8945b5034bba5f9df719cff2503495"><div class="ttname"><a href="namespaceripple.html#a7c8945b5034bba5f9df719cff2503495">ripple::composed_quality</a></div><div class="ttdeci">Quality composed_quality(Quality const &amp;lhs, Quality const &amp;rhs)</div><div class="ttdef"><b>Definition:</b> <a href="Quality_8cpp_source.html#l00103">Quality.cpp:103</a></div></div>
<div class="ttc" id="anamespaceripple_html_a7c8945b5034bba5f9df719cff2503495"><div class="ttname"><a href="namespaceripple.html#a7c8945b5034bba5f9df719cff2503495">ripple::composed_quality</a></div><div class="ttdeci">Quality composed_quality(Quality const &amp;lhs, Quality const &amp;rhs)</div><div class="ttdef"><b>Definition:</b> <a href="Quality_8cpp_source.html#l00101">Quality.cpp:101</a></div></div>
<div class="ttc" id="anamespaceripple_html_a7cc64e12723fbc9606d85442a2569feda13b5bfe96f3e2fe411c9f66f4a582adf"><div class="ttname"><a href="namespaceripple.html#a7cc64e12723fbc9606d85442a2569feda13b5bfe96f3e2fe411c9f66f4a582adf">ripple::QualityDirection::in</a></div><div class="ttdeci">@ in</div></div>
<div class="ttc" id="anamespaceripple_html_a7806e73f2a04df365821602cfcf89ff2"><div class="ttname"><a href="namespaceripple.html#a7806e73f2a04df365821602cfcf89ff2">ripple::mulRound</a></div><div class="ttdeci">STAmount mulRound(STAmount const &amp;v1, STAmount const &amp;v2, Issue const &amp;issue, bool roundUp)</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8cpp_source.html#l01173">STAmount.cpp:1173</a></div></div>
<div class="ttc" id="anamespaceripple_html_a73cc988e7ba5d5ee0fd9db53740917ec"><div class="ttname"><a href="namespaceripple.html#a73cc988e7ba5d5ee0fd9db53740917ec">ripple::getRate</a></div><div class="ttdeci">std::uint64_t getRate(STAmount const &amp;offerOut, STAmount const &amp;offerIn)</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8cpp_source.html#l00423">STAmount.cpp:423</a></div></div>
<div class="ttc" id="anamespaceripple_html_a7806e73f2a04df365821602cfcf89ff2"><div class="ttname"><a href="namespaceripple.html#a7806e73f2a04df365821602cfcf89ff2">ripple::mulRound</a></div><div class="ttdeci">STAmount mulRound(STAmount const &amp;v1, STAmount const &amp;v2, Issue const &amp;issue, bool roundUp)</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8cpp_source.html#l01199">STAmount.cpp:1199</a></div></div>
<div class="ttc" id="anamespaceripple_html_a73cc988e7ba5d5ee0fd9db53740917ec"><div class="ttname"><a href="namespaceripple.html#a73cc988e7ba5d5ee0fd9db53740917ec">ripple::getRate</a></div><div class="ttdeci">std::uint64_t getRate(STAmount const &amp;offerOut, STAmount const &amp;offerIn)</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8cpp_source.html#l00440">STAmount.cpp:440</a></div></div>
<div class="ttc" id="anamespaceripple_html_a7cc64e12723fbc9606d85442a2569fedac68271a63ddbc431c307beb7d2918275"><div class="ttname"><a href="namespaceripple.html#a7cc64e12723fbc9606d85442a2569fedac68271a63ddbc431c307beb7d2918275">ripple::QualityDirection::out</a></div><div class="ttdeci">@ out</div></div>
<div class="ttc" id="anamespaceripple_html_a47b15adfd6fb69767c64f50d860a11cc"><div class="ttname"><a href="namespaceripple.html#a47b15adfd6fb69767c64f50d860a11cc">ripple::divRound</a></div><div class="ttdeci">STAmount divRound(STAmount const &amp;num, STAmount const &amp;den, Issue const &amp;issue, bool roundUp)</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8cpp_source.html#l01257">STAmount.cpp:1257</a></div></div>
<div class="ttc" id="anamespaceripple_html_a47b15adfd6fb69767c64f50d860a11cc"><div class="ttname"><a href="namespaceripple.html#a47b15adfd6fb69767c64f50d860a11cc">ripple::divRound</a></div><div class="ttdeci">STAmount divRound(STAmount const &amp;num, STAmount const &amp;den, Issue const &amp;issue, bool roundUp)</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8cpp_source.html#l01285">STAmount.cpp:1285</a></div></div>
<div class="ttc" id="aclassripple_1_1STAmount_html"><div class="ttname"><a href="classripple_1_1STAmount.html">ripple::STAmount</a></div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8h_source.html#l00042">STAmount.h:42</a></div></div>
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint64_t</a></div></div>
<div class="ttc" id="anamespaceripple_html"><div class="ttname"><a href="namespaceripple.html">ripple</a></div><div class="ttdoc">Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.</div><div class="ttdef"><b>Definition:</b> <a href="RCLCensorshipDetector_8h_source.html#l00029">RCLCensorshipDetector.h:29</a></div></div>
<div class="ttc" id="alimits_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/limits.html">limits</a></div></div>
<div class="ttc" id="aclassripple_1_1STAmount_html_a60d8449d2915fa495f12994f56ceca34"><div class="ttname"><a href="classripple_1_1STAmount.html#a60d8449d2915fa495f12994f56ceca34">ripple::STAmount::issue</a></div><div class="ttdeci">Issue const &amp; issue() const</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8h_source.html#l00156">STAmount.h:156</a></div></div>
<div class="ttc" id="aclassripple_1_1STAmount_html_a60d8449d2915fa495f12994f56ceca34"><div class="ttname"><a href="classripple_1_1STAmount.html#a60d8449d2915fa495f12994f56ceca34">ripple::STAmount::issue</a></div><div class="ttdeci">Issue const &amp; issue() const</div><div class="ttdef"><b>Definition:</b> <a href="STAmount_8h_source.html#l00197">STAmount.h:197</a></div></div>
<div class="ttc" id="acassert_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/header/cassert.html">cassert</a></div></div>
<div class="ttc" id="aprev_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/prev.html">std::prev</a></div><div class="ttdeci">T prev(T... args)</div></div>
<div class="ttc" id="anumeric_limits_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/numeric_limits.html">std::numeric_limits</a></div></div>