Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 12th, 2006, 3:06 PM   #11
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by reggaeton_king
it returns 0 - 0.99999999999999999999, better explanation
You need about a thousand more nines
Arevos is offline   Reply With Quote
Old Feb 12th, 2006, 3:37 PM   #12
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
lol hell yeah!
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Feb 14th, 2006, 5:14 AM   #13
kurt
Programmer
 
Join Date: Oct 2005
Posts: 68
Rep Power: 3 kurt is on a distinguished road
oh, so its like

0 <= range < 1 ?

All right. Thanks
kurt is offline   Reply With Quote
Old Feb 14th, 2006, 7:01 AM   #14
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 3 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
correcto hombre!
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Feb 14th, 2006, 9:54 AM   #15
Barbo
Newbie
 
Join Date: Aug 2004
Posts: 24
Rep Power: 0 Barbo is on a distinguished road
Send a message via MSN to Barbo
try this:
Random randomNumber = new Random();
		//System.out.println(randomNumber.nextDouble());
		for (int i = 0 ; i < 25 ; i++ ) 
			System.out.println(6 + randomNumber.nextInt(4) + randomNumber.nextDouble());
this is a sample run:
6.95024411452378
8.984710728367434
7.676017897878788
9.912265649942277
6.280182735503483
7.1027155377329505
8.08007342026028
9.366193420493138
9.41443596850575
7.754715326042548
7.76242243321119
9.931977732359908
9.041430710331346
8.856345083925039
8.013217034792513
8.07149075911434
6.907854553043988
9.11328827937263
8.212997676355142
7.726108944876039
7.830853487056025
9.567757499627561
6.492143447243985
7.796354471280454
9.020392284622606
Barbo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:15 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC