initial commit
This commit is contained in:
21
src/main.cpp
Normal file
21
src/main.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include "ReUnirand/unirand.hpp"
|
||||
|
||||
int main() {
|
||||
ReUnirand::MarsagliaUniRng rng;
|
||||
|
||||
try {
|
||||
// Initialise the generator with a seed value.
|
||||
rng.rinit(170);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
std::cerr << "Error initialising RNG: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Generate a random number and display it.
|
||||
float randomValue = rng.uni();
|
||||
std::cout << "Random Number: " << randomValue << std::endl;
|
||||
std::cout << "The result should be: 0.687533" << std::endl;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user