mirror of
https://github.com/boostorg/multiprecision.git
synced 2026-02-19 02:22:17 +00:00
Change floating point to rational number conversions to be implicit as per https://svn.boost.org/trac/boost/ticket/10082.
This commit is contained in:
@@ -28,6 +28,14 @@
|
||||
</h3></div></div></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h0"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.multiprecision_2_2_2"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.multiprecision_2_2_2">Multiprecision-2.2.2</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||||
Change floating point to rational conversions to be implicit, see [https://svn.boost.org/trac/boost/ticket/10082
|
||||
10082].
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h1"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.multiprecision_2_2_1_boost_1_56"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.multiprecision_2_2_1_boost_1_56">Multiprecision-2.2.1
|
||||
(Boost-1.56)</a>
|
||||
</h5>
|
||||
@@ -35,7 +43,7 @@
|
||||
Fix bug in assignment from string in cpp_int, see <a href="https://svn.boost.org/trac/boost/ticket/9936" target="_top">9936</a>.
|
||||
</li></ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h1"></a>
|
||||
<a name="boost_multiprecision.map.hist.h2"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.multiprecision_2_2_0"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.multiprecision_2_2_0">Multiprecision-2.2.0</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -63,7 +71,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h2"></a>
|
||||
<a name="boost_multiprecision.map.hist.h3"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.boost_1_55"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.boost_1_55">Boost-1.55</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -101,7 +109,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h3"></a>
|
||||
<a name="boost_multiprecision.map.hist.h4"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.1_54"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.1_54">1.54</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -156,7 +164,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h4"></a>
|
||||
<a name="boost_multiprecision.map.hist.h5"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.1_53"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.1_53">1.53</a>
|
||||
</h5>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||||
@@ -172,7 +180,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h5"></a>
|
||||
<a name="boost_multiprecision.map.hist.h6"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.post_review_changes"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.post_review_changes">Post
|
||||
review changes</a>
|
||||
</h5>
|
||||
@@ -226,7 +234,7 @@
|
||||
</li>
|
||||
</ul></div>
|
||||
<h5>
|
||||
<a name="boost_multiprecision.map.hist.h6"></a>
|
||||
<a name="boost_multiprecision.map.hist.h7"></a>
|
||||
<span class="phrase"><a name="boost_multiprecision.map.hist.pre_review_history"></a></span><a class="link" href="hist.html#boost_multiprecision.map.hist.pre_review_history">Pre-review
|
||||
history</a>
|
||||
</h5>
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"><p><small>Last revised: May 23, 2014 at 11:16:27 GMT</small></p></td>
|
||||
<td align="left"><p><small>Last revised: June 01, 2014 at 17:35:12 GMT</small></p></td>
|
||||
<td align="right"><div class="copyright-footer"></div></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
|
||||
@@ -4919,6 +4919,10 @@ Windows Vista machine.
|
||||
|
||||
[section:hist History]
|
||||
|
||||
[h4 Multiprecision-2.2.2]
|
||||
|
||||
* Change floating point to rational conversions to be implicit, see [https://svn.boost.org/trac/boost/ticket/10082 10082].
|
||||
|
||||
[h4 Multiprecision-2.2.1 (Boost-1.56)]
|
||||
|
||||
* Fix bug in assignment from string in cpp_int, see [@https://svn.boost.org/trac/boost/ticket/9936 9936].
|
||||
|
||||
@@ -165,10 +165,17 @@ struct rational_adaptor
|
||||
return m_value > o.m_value ? 1 : (m_value < o.m_value ? -1 : 0);
|
||||
}
|
||||
template <class Arithmatic>
|
||||
typename enable_if<is_arithmetic<Arithmatic>, int>::type compare(Arithmatic i)const
|
||||
typename enable_if_c<is_arithmetic<Arithmatic>::value && !is_floating_point<Arithmatic>::value, int>::type compare(Arithmatic i)const
|
||||
{
|
||||
return m_value > i ? 1 : (m_value < i ? -1 : 0);
|
||||
}
|
||||
template <class Arithmatic>
|
||||
typename enable_if_c<is_floating_point<Arithmatic>::value, int>::type compare(Arithmatic i)const
|
||||
{
|
||||
rational_adaptor r;
|
||||
r = i;
|
||||
return this->compare(r);
|
||||
}
|
||||
rational_type& data() { return m_value; }
|
||||
const rational_type& data()const { return m_value; }
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ struct is_lossy_conversion
|
||||
{
|
||||
typedef typename mpl::if_c<
|
||||
((number_category<From>::value == number_kind_floating_point) && (number_category<To>::value == number_kind_integer))
|
||||
|| ((number_category<From>::value == number_kind_floating_point) && (number_category<To>::value == number_kind_rational))
|
||||
/* || ((number_category<From>::value == number_kind_floating_point) && (number_category<To>::value == number_kind_rational))*/
|
||||
|| ((number_category<From>::value == number_kind_rational) && (number_category<To>::value == number_kind_integer))
|
||||
|| ((number_category<From>::value == number_kind_fixed_point) && (number_category<To>::value == number_kind_integer))
|
||||
|| (number_category<From>::value == number_kind_unknown)
|
||||
|
||||
Reference in New Issue
Block a user