Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
multi variable random number generator
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { double doubleupperlimit = 2000000; double doublelowerlimit = 1000000; while(doubleupperlimit > 1) { doubleupperlimit = doubleupperlimit / 10; Console.WriteLine(doubleupperlimit); } Console.WriteLine("done"); int divisionsNum = 0; while(doublelowerlimit >= 1) { doublelowerlimit = doublelowerlimit / 10; Console.WriteLine(doublelowerlimit); divisionsNum++; } Console.WriteLine("done"); long ld = 0; Random r = new Random(); bool done = false; while(!done) { double value = r.NextDouble(); Console.WriteLine(value); if (value < doubleupperlimit && value > doublelowerlimit) { ld = (long) (value * Math.Pow(10, divisionsNum)); done = true; } } Console.WriteLine(ld); } } }
run
|
edit
|
history
|
help
0
Reflection custom test
Ruben
TEst
ProtectedUse
Program
Fibonacci Recursive C#
mo3dal
clientdata.cs
Testing 12
asxsdf