Boost logo

Boost Users :

From: John Maddock (jz.maddock_at_[hidden])
Date: 2021-07-21 21:40:24

On 21/07/2021 19:07, Stefano Gragnani via Boost-users wrote:
> further clarification if possible:
> why the 2 lines that don't compile:
> // float128 e1 = exp(1.Q); // Note argument to exp is type float128.
> // std::cout << e1 << std::endl; // 2.71828182845904523536028747135266231
>  if i put them in the following code compile regularly?

You're mixing up 2 different things:

* If you want to use __float128 "as if" it were no different to
float/double etc, then include boost/math/cstdfloat.hpp

* If you want a 128-bit floating point type which hides the underlying
implementation then use boost/multiprecision/float128.hpp.

Note that these are completely different approaches to the same problem,
and are completely different types.

Also note that strictly speaking, boost/math/cstdfloat.hpp is NOT C++
conformant, as it adds function overloads directly to namespace std.

This email has been checked for viruses by Avast antivirus software.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at