I'm guessing you want the generated numbers to be long doubles, instead of generating doubles and then casting to long doubles. If so, the answer's no, but you can give the uniform_real_distribution a template argument to change the types of numbers that it generates: std::uniform_real_distribution<longdouble> dist(a,b);