![]() |
| | #1 |
| Registered User Join Date: Feb 2008
Posts: 102
| Question about random numbers If I generate numbers with the same seed, but run the program in different machine, does I will obtein the same numbers? If I generate numbers with th same seed always, but make two programs with differents compilers..... does I will obtein different numbers from both programs when executed? thx. |
| Kempelen is offline | |
| | #2 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,292
| Sounds pretty "homeworky". I suggest you learn how they work, and that way you can answer all of your own questions. Not to mention you'll learn something http://www.eternallyconfuzzled.com/t..._tut_rand.aspx |
| zacs7 is offline | |
| | #3 |
| Code Goddess Join Date: Sep 2001
Posts: 9,664
| >if I generate numbers with the same seed always...... does I will >obtein always the same numbers when executing my program? Yes. >If I generate numbers with the same seed, but run the program >in different machine, does I will obtein the same numbers? Perhaps. It depends on how you link to the random number generator. If it's dynamically linked and the different machine uses a different generator, you'll likely get a different sequence. >If I generate numbers with th same seed always, but make two programs with differents >compilers..... does I will obtein different numbers from both programs when executed? Probably not, unless both compilers use the same algorithm or link to the same generator provided by the target system.
__________________ My best code is written with the delete key. |
| Prelude is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Criteria based random numbers | alkisclio | C++ Programming | 6 | 09-14-2006 12:29 PM |
| calculating the variance of random numbers | Unregistered | C Programming | 18 | 11-22-2004 08:16 AM |
| Generating Random Numbers | FromHolland | C++ Programming | 6 | 06-16-2003 09:05 AM |
| Generate random numbers in Lucky7 project using C# | Grayson_Peddie | C# Programming | 1 | 04-11-2003 11:03 PM |
| Help generating random numbers in MFC | drb2k2 | C++ Programming | 3 | 04-08-2003 08:52 AM |