By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,254 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,254 IT Pros & Developers. It's quick & easy.

Randomize Double Number in VB .NET 2005

P: 1
Hi all,
Is there any of u know how to randomize a double number in VB then use it as decimal type?
I've try it many times, but unfortunately i'm still failed. I used this :

private sub Init()
dim objRandom as System.Random
dim v(5,20), w(5) as decimal
dim Rndv(5,20), Rndw(5) as double
dim i,j as integer

for j = 0 to 4
for i = 0 to 19
Rndv(j,i)=objRandom.nextdouble()
v(j,i)=Rndv(j,i)-0.5
next i
Rndw(j)=objRandom.nextdouble()
w(j0=Rndw(j)-0.5
next j

end sub

thanks
Apr 24 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.