|
|
|
Click here to copy the following block |
Function NormRand() As Double Dim fac As Double, rsq As Double, v1 As Double, v2 As Double Static flag As Boolean, gset As Double If flag Then NormRand = gset flag = False Else Do v1 = 2 * Rnd - 1# v2 = 2 * Rnd - 1# rsq = v1 * v1 + v2 * v2 Loop Until rsq <= 1# fac = Sqr(-2# * Log(rsq) / rsq) NormRand = v2 * fac gset = v1 * fac flag = True End If End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|