[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] 'sandsynligheds'-funktion



John Mørck Hansen <sslug@sslug> writes:

> Kan det ikke gøres på noget ala denne måde:
>
>    return (rand()%(100 - ParmVal));

Det vil give tal mellem 0 og 100-ParmVal---Ikke hvad Marie Louise
ønsker.

Hvis man skal bruge tilfældige tal mellem 0 og 100 er det iøvrigt en
meget dårlig ide bare at bruge 'rand()%100'. Det vil give en
overrepræsentation af tallene fra 0 til RAND_MAX%100.

I øvrigt er der nogle maskiner hvor tilfældigheden af de mindst
betydende bits ikke er særlig god.

-- 
SSLUGs julekalender - hver dag fra den 1. til den 24. december
   http://www.sslug.dk/julekalender/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *