[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



sslug@sslug skrev:
> 
>  Jeg skal lave en sandsynligheds-funktion, der givet et tal imellem 0 og
>  100, returnerer 1 med <tal>% sandsynlighed, og 0 med <100 - tal>%
>  sandsynlighed.
>
>  dvs. givet tallet 40 skal funktionen returnere 1 40% af gangene, og 0 60%
>  af gangene, funktionen bliver kaldt.

Kan det ikke gøres på noget ala denne måde:

   return (rand()%(100 - ParmVal));


(John =;-)
-- 
Din sikre vej til en sikker backup løsning til dit netværk.
http://www.adilock.dk/~john/
http://www.adilock.dk


 
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] *