High Presicion Random Double Numbers : This is a follow up question on an answer on this page:

[How to generate random double numbers with high precision in C++?][1]

    #include <iostream>
    #include <random>
    #include <iomanip>    

    int main()
    {
        std::random_device rd;

        std::mt19937 e2(rd());

       std::uniform_real_distribution<> dist(1, 10);

       for( int i = 0 ; i < 10; ++i )
       {
          std::cout << std::fixed << std::setprecision(10) << dist(e2) << std::endl ;
       }

      return 0 ;
    }

The answer works fine but I had a hard time to reliaze how to put the output of this code in a double variable instead of printing it on the STDOUT. Can anyone help with this?

Thanks.

  [1]: http://stackoverflow.com/a/18131869/3199911