A pseudorandom number generator such as PHP rand()
fault and new Random.Next()
fault will return different values even using the same seed and even full scope , and this is not the correct one for my project to work correctly on different platforms.
For example, I've compiled a 123 seed random number in a range of 1 to 100 , and all .NET returned 98 on the first call. But by using the same script in PHP, it was returned 7 , which makes no connection to the .NET compiler . >
Below is the code used in .NET to generate the random number by rextester.com
Here,anotherexample,samecode,sameoutput,compiledonlyinDotNetFiddle
Andfinally,thesamecodepractically,butcompiledinPHP:
AndalsoinC++thishappens:
How can I make a random number to be generated exactly to the same seed only on another platform?