Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ random number 0 to 1

#include <iostream>
#include <string>
#include <random>

int main() {
    std::mt19937 gen (123);
    std::uniform_real_distribution<double> dis(0.0, 1.0);
    double x = dis(gen);
    std::cout << x << std::endl;
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #random #number
ADD COMMENT
Topic
Name
3+6 =