Re: random numbers in fortran



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.
.



Relevant Pages

  • Re: isnt there a one shooting per week rule?
    ... Zero. ... Dick Cheney and Karl Rove never get their hands dirty. ... install a UHF antenna and a DVD player. ... I can rent DVDs to watch movies and I can watch ...
    (misc.writing)
  • Re: television is such a strange thing
    ... $Zero goes: ... Nobody will watch TV in 10 years. ... hopefuilly because they'll all be bickerfesting in two years: ...
    (misc.writing)
  • Lio 12/23
    ... AD/CE - note that ORACLE database software rejects year zero, ... Even if Lio's watch uses some sort of astronomical dating system ...
    (rec.arts.comics.strips)
  • Re: Duplicate Records in tables
    ... Infected04, Yes, there is a way, but it is not advisable, since there are ... There will be many considerations when handling updates and reading on ... Set the "Indexed" property of the number field to "Yes - No Duplicates." ... For the number zero do not update, or update the field with Null ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Adding a watch expression in VB
    ... I sometimes need to break sttatements into pieces to debug problem ... I have all my variables declared and linked to excel but it is still ... False is defined as zero and true is any value that is not zero. ... The look at the watch. ...
    (microsoft.public.excel.programming)