Re: random numbers in fortran
- From: Thomas Koenig <Thomas.Koenig@xxxxxxxxx>
- Date: Mon, 27 Nov 2006 21:04:29 +0100 (CET)
lane straatman <grumpy196884@xxxxxxxxxxx> wrote:
Since I want to simulate shuffling a deck of cards, I guess I'll ask
for 52 pseudorandoms at a pop, multiply by 52 and take the floor.
Watch out for duplicates :-)
Try the Knuth shuffle instead, see for example
http://en.wikipedia.org/wiki/Shuffling_playing_cards
I
believe this gives random ints between zero and fifty-one. Is a person
well advised to start his arrays at zero as with C?
Customary for Fortran is one, and this idiom usually causes
the least surprises.
.
- References:
- random numbers in fortran
- From: lane straatman
- Re: random numbers in fortran
- From: Thomas Koenig
- random numbers in fortran
- Prev by Date: Re: rounding a number
- Next by Date: Re: random numbers in fortran
- Previous by thread: Re: random numbers in fortran
- Next by thread: Re: random numbers in fortran
- Index(es):
Relevant Pages
|