Boost logo

Boost Users :

Subject: [Boost-users] [multiprecision] static_cast<cpp_bin_float_100> gives strange values.
From: Vögl, Christian (christian.voegl_at_[hidden])
Date: 2018-04-20 15:44:24


Hi everyone.
The following Situation:

I tried to improve the accuracy of a numerical function by replacing all
double variables with cpp_bin_float_100.
The parameters of this function contain two 3-element double arrays,
which I convert to cpp_bin_float_100 by the following function:

static void equal(cpp_bin_float_100* a, double* b)
{

        for(int i=0; i<3;i++)
        {
                a[i]=static_cast<cpp_bin_float_100>(b[i]);
        }
}

the third element seems to be converted correctly, the first and second
are totally off. (e. g. 100 -> 1.5625)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net