From e293cc3f8edd1fccabeece94e07250cff50c8d22 Mon Sep 17 00:00:00 2001 From: hikari Date: Thu, 9 Dec 2021 19:20:41 +0900 Subject: [PATCH] Update SystemRandomSource.cs Fixed a seed value issue in the .NET Framework. --- src/Numerics/Random/SystemRandomSource.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Numerics/Random/SystemRandomSource.cs b/src/Numerics/Random/SystemRandomSource.cs index 72e4d096..a0fd1038 100644 --- a/src/Numerics/Random/SystemRandomSource.cs +++ b/src/Numerics/Random/SystemRandomSource.cs @@ -51,7 +51,11 @@ namespace MathNet.Numerics.Random /// public SystemRandomSource() { +#if NETCOREAPP _random = new System.Random(); +#else + _random = new System.Random(RandomSeed.Robust()); +#endif } /// @@ -60,7 +64,11 @@ namespace MathNet.Numerics.Random /// if set to true , the class is thread safe. public SystemRandomSource(bool threadSafe) : base(threadSafe) { +#if NETCOREAPP _random = new System.Random(); +#else + _random = new System.Random(RandomSeed.Robust()); +#endif } ///