Created
December 24, 2012 04:37
-
-
Save anonymous/4367551 to your computer and use it in GitHub Desktop.
Random Device
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // g++ -std=c++11 random.cpp -o random | |
| #include <iostream> | |
| #include <random> | |
| int main () | |
| { | |
| std::random_device rd; | |
| std::cout << "default random_device characteristics:" << std::endl; | |
| std::cout << "minimum: " << rd.min() << std::endl; | |
| std::cout << "maximum: " << rd.max() << std::endl; | |
| std::cout << "entropy: " << rd.entropy() << std::endl; | |
| std::cout << "a random number: " << rd() << std::endl; | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment