__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
support, function names in libquadmath all have different names to the
ones etc.) So you can program type
directly, but it's harder work.
float128 uses __float128
and makes it C++ and generic code friendly, with all the usual standard
available, so strongly recommended for C++ use.
Make sure you declare variables with the correct type, here
Make sure that if you pass a variable to a function then it is casted to
Make sure you declare literals with the correct suffix - otherwise they'll
be treated as type
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
Some examples of what can go horribly and silently wrong are at float128_example.cpp.