[CLN-list] Operations with different precisions
Richard B. Kreckel
kreckel at ginac.de
Mon Oct 12 21:04:06 CEST 2009
Hi,
Sebastian Macke wrote:
> following code snippet
>
> cln::cl_F x = cl_float(0.5, cln::float_format(50));
> x = cos(x);
> cout << "\n" << x << "\n";
> x = x + cln::cl_F(1.);
> cout << x << "\n";
>
> gives the output
>
> 0.8775825618903727161162815826038296519916451971097440529976L0
> 1.8775825618903728d0
>
> Is there a feature that the float with the highest precision
> is used as the result precision?
I suppose a typo: Of course, in operators taking two floats, the
precision of the float with the *least* precision is used as the result
precision.
Regards
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
More information about the CLN-list
mailing list