-
-
Notifications
You must be signed in to change notification settings - Fork 82
Kasugaccho edited this page Mar 8, 2019
·
2 revisions
std::uint_fast32_t dtl::random::mersenne_twister_32bit();
例
#include <iostream>
#include "DTL.hpp"
int main() {
for (int i{}; i < 10; ++i)
std::cout << dtl::random::mersenne_twister_32bit() << std::endl;
return 0;
}
出力例
875639570
3539211287
688681168
3806140501
157396773
729477269
2014359681
306063025
4211512868
3067440185
std::int_fast32_t dtl::random::mersenne_twister_32bit(std::int_fast32_t n);
例
#include <iostream>
#include "DTL.hpp"
int main() {
for (int i{}; i < 10; ++i)
std::cout << dtl::random::mersenne_twister_32bit(6) << std::endl;
return 0;
}
出力例
2
3
0
4
1
5
1
5
3
4
std::int_fast32_t dtl::random::mersenne_twister_32bit(std::int_fast32_t start, std::int_fast32_t end);
例
#include <iostream>
#include "DTL.hpp"
int main() {
for (int i{}; i < 10; ++i)
std::cout << dtl::random::mersenne_twister_32bit(0, 4) << std::endl;
return 0;
}
出力例
3
4
2
0
0
1
4
2
4
3
bool dtl::random::mersenne_twister_32bit.probability();
例
#include <iostream>
#include "DTL.hpp"
int main() {
for (int i{}; i < 10; ++i)
std::cout << dtl::random::mersenne_twister_32bit.probability() << std::endl;
return 0;
}
出力例
1
0
1
0
0
1
1
1
0
0
bool dtl::random::mersenne_twister_32bit.probability(double n);
例
#include <iostream>
#include "DTL.hpp"
int main() {
for (int i{}; i < 10; ++i)
std::cout << dtl::random::mersenne_twister_32bit.probability(0.7) << std::endl;
return 0;
}
出力例
1
0
1
1
0
0
1
1
1
1
void dtl::random::mersenne_twister_32bit.seed();
void dtl::random::mersenne_twister_32bit.seed(std::uint_fast32_t seed);
Copyright (c) 2018-2021 As Project.
Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)