From e0737c56c1e384e05064a0c6e1ac46979371041b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 19 Dec 2018 22:58:32 +0100 Subject: New upstream version 2.0.0+repack --- .../html/math_toolkit/float128/exp_function.html | 71 ++++++++++++++++ .../html/math_toolkit/float128/overloading.html | 97 ++++++++++++++++++++++ .../float128/overloading_template_functions_w.html | 97 ++++++++++++++++++++++ .../doc/html/math_toolkit/float128/typeinfo.html | 78 +++++++++++++++++ 4 files changed, 343 insertions(+) create mode 100644 boost/libs/math/doc/html/math_toolkit/float128/exp_function.html create mode 100644 boost/libs/math/doc/html/math_toolkit/float128/overloading.html create mode 100644 boost/libs/math/doc/html/math_toolkit/float128/overloading_template_functions_w.html create mode 100644 boost/libs/math/doc/html/math_toolkit/float128/typeinfo.html (limited to 'boost/libs/math/doc/html/math_toolkit/float128') diff --git a/boost/libs/math/doc/html/math_toolkit/float128/exp_function.html b/boost/libs/math/doc/html/math_toolkit/float128/exp_function.html new file mode 100644 index 00000000..ef51ee7c --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/float128/exp_function.html @@ -0,0 +1,71 @@ + + + +Exponential function + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ There was a bug when using any quadmath expq + function on GCC : GCC + bug #60349 caused by mingw-64 + bug #368. +

+

+ To work round this defect, an alternative implementation of 128-bit exp was + temporarily provided by boost/cstdfloat.hpp. +

+

+ The mingw bug was fixed at 2014-03-12 and GCC 6.1.1 now works as expected. +

+
+ + + + + +
[Tip]Tip

+ It is essential to link to the quadmath library +

+

+ . +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/float128/overloading.html b/boost/libs/math/doc/html/math_toolkit/float128/overloading.html new file mode 100644 index 00000000..e8d9271b --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/float128/overloading.html @@ -0,0 +1,97 @@ + + + +Overloading template functions with float128_t + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ An artifact of providing C++ standard library support for quadmath may mandate + the inclusion of <boost/cstdfloat.hpp> + before the inclusion of other headers. +

+

+ Consider a function that calls fabs(x) + and has previously injected std::fabs() into local scope via a using + directive: +

+
template <class T>
+bool unsigned_compare(T a, T b)
+{
+   using std::fabs;
+   return fabs(a) == fabs(b);
+}
+
+

+ In this function, the correct overload of fabs + may be found via argument-dependent-lookup + (ADL) or by calling one of the std::fabs + overloads. There is a key difference between them however: an overload in + the same namespace as T and found via ADL need not + be defined at the time the function is declared. However, + all the types declared in <boost/cstdfloat.hpp> + are fundamental types, so for these types we are relying on finding an overload + declared in namespace std. + In that case however, all such overloads + must be declared prior to the definition of function unsigned_compare + otherwise they are not considered. +

+

+ In the event that <boost/cstdfloat.hpp> + has been included after the definition of + the above function, the correct overload of fabs, + while present, is simply not considered as part of the overload set. So the + compiler tries to downcast the float128_t + argument first to long double, + then to double, then to float; the compilation fails because the result + is ambiguous. However the compiler error message will appear cruelly inscrutable, + at an apparently irelevant line number and making no mention of float128: the word ambiguous + is the clue to what is wrong. +

+

+ Provided you #include <boost/cstdfloat.hpp> + before the inclusion of the any header containing + generic floating point code (such as other Boost.Math headers, then the compiler + will know about and use the std::fabs(std::float128_t) + that we provide in #include <boost/cstdfloat.hpp>. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/float128/overloading_template_functions_w.html b/boost/libs/math/doc/html/math_toolkit/float128/overloading_template_functions_w.html new file mode 100644 index 00000000..bb8986af --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/float128/overloading_template_functions_w.html @@ -0,0 +1,97 @@ + + + +Overloading template functions with float128_t + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ An artifact of providing C++ standard library support for quadmath may mandate + the inclusion of <boost/cstdfloat.hpp> + before the inclusion of other headers. +

+

+ Consider a function that calls fabs(x) + and has previously injected std::fabs() into local scope via a using + directive: +

+
template <class T>
+bool unsigned_compare(T a, T b)
+{
+   using std::fabs;
+   return fabs(a) == fabs(b);
+}
+
+

+ In this function, the correct overload of fabs + may be found via argument-dependent-lookup + (ADL) or by calling one of the std::fabs + overloads. There is a key difference between them however: an overload in + the same namespace as T and found via ADL need not + be defined at the time the function is declared. However, + all the types declared in <boost/cstdfloat.hpp> + are fundamental types, so for these types we are relying on finding an overload + declared in namespace std. + In that case however, all such overloads + must be declared prior to the definition of function unsigned_compare + otherwise they are not considered. +

+

+ In the event that <boost/cstdfloat.hpp> + has been included after the definition of + the above function, the correct overload of fabs, + while present, is simply not considered as part of the overload set. So the + compiler tries to downcast the float128_t + argument first to long double, + then to double, then to float; the compilation fails because the result + is ambiguous. However the compiler error message will appear cruelly inscrutable, + at an apparently irelevant line number and making no mention of float128: the word ambiguous + is the clue to what is wrong. +

+

+ Provided you #include <boost/cstdfloat.hpp> + before the inclusion of the any header containing + generic floating point code (such as other Boost.Math headers, then the compiler + will know about and use the std::fabs(std::float128_t) + that we provide in #include <boost/cstdfloat.hpp>. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/float128/typeinfo.html b/boost/libs/math/doc/html/math_toolkit/float128/typeinfo.html new file mode 100644 index 00000000..88467ff4 --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/float128/typeinfo.html @@ -0,0 +1,78 @@ + + + +typeinfo + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ For GCC 4.8.1 it was not yet possible to use typeinfo + for float_128 on GCC: see + GCC 43622. +

+

+ So this code (to display the mangled name) failed to link undefined + reference to + typeinfo for + __float128 +

+
std::cout << typeid(boost::float128_t).name() << std::endl;
+
+

+ This prevent using the existing tests for Boost.Math distributions, (unless + a few lines are commented out) and if a MACRO BOOST_MATH_INSTRUMENT controlling + them is defined then some diagnostic displays in Boost.Math will not work. +

+

+ However this was only used for display purposes and could be commented out + until this was fixed in GCC 5. +

+
+ + + + + +
[Tip]Tip

+ Not all managed names can be displayed + using std::cout. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + -- cgit v1.2.3