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 --- .../math/doc/html/math_toolkit/float128_hints.html | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 boost/libs/math/doc/html/math_toolkit/float128_hints.html (limited to 'boost/libs/math/doc/html/math_toolkit/float128_hints.html') diff --git a/boost/libs/math/doc/html/math_toolkit/float128_hints.html b/boost/libs/math/doc/html/math_toolkit/float128_hints.html new file mode 100644 index 00000000..a181bf5a --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/float128_hints.html @@ -0,0 +1,107 @@ + + + +Hints on using float128 (and __float128) + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + __float128 + versus float128 +
+
    +
  • + __float128 is the (optionally) compiler supplied hardware type, it's an + C-ish extension to C++ and there is only minimal support for it in normal + C++ (no IO streams or numeric_limits + support, function names in libquadmath all have different names to the + std:: + ones etc.) So you can program type __float128 + directly, but it's harder work. +
  • +
  • + Type float128 uses __float128 + and makes it C++ and generic code friendly, with all the usual standard + iostream, numeric_limits, complex + in namspace std:: + available, so strongly recommended for C++ use. +
  • +
+
+ + Hints + and tips +
+
    +
  • + Make sure you declare variables with the correct type, here float128. +
  • +
  • + Make sure that if you pass a variable to a function then it is casted to + float128. +
  • +
  • + Make sure you declare literals with the correct suffix - otherwise they'll + be treated as type double + with catastrophic loss of precision. So make sure they have a Q suffix + for 128-bit floating-point literals. +
  • +
  • + All the std library functions, cmath functions, plus all the constants, + and special functions from Boost.Math should then just work. +
  • +
  • + Make sure std lib functions are called unqualified + so that the correct overload is found via Argument + Dependent Lookup (ADL). So write sqrt(variable) and not std::sqrt(variable). +
  • +
  • + In general, try not to reinvent stuff - using constants from Boost.Math + is probably less error prone than declaring your own, likewise the special + functions etc. +
  • +
+

+ Some examples of what can go horribly and silently wrong are at float128_example.cpp. +

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