Comments on: Generate Random Double Numbers in a Range in C# https://code-maze.com/csharp-random-double-range/ Learn. Code. Succeed. Tue, 11 Jan 2022 10:50:14 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: Twein https://code-maze.com/csharp-random-double-range/#comment-4913 Tue, 11 Jan 2022 10:50:14 +0000 https://drafts.code-maze.com/?p=61516#comment-4913 Use this one if you need a uniform distribution:

        public static double GetSecureDouble()
        {
            RandomNumberGenerator.Create();
            var numerator = RandomNumberGenerator.GetInt32(0, int.MaxValue);
            double sDouble = (double)numerator / int.MaxValue;
            return sDouble;
        }
]]>