aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Random Number from Math Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Random Number from Math" Watch "Random Number from Math" New topic
Author

Random Number from Math

Shiny
Ranch Hand

Joined: May 29, 2000
Posts: 45
Can the 'random' method of Math class return 0.0 and 1.0 ? I think, 0.0 is inclusive while 1.0 is NOT.
some one please confirm,
thanks
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Yes Shiny , that is what the documentation also says.To quote the Java2API
"Returns a random number greater than or equal to 0.0 and less than 1.0."
mmkris_1
Greenhorn

Joined: Jun 18, 2000
Posts: 15
[0,1)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Random Number from Math
 
Similar Threads
extremes of Math.ceil
Generating Random Number
Math.round() duffulty
Random method
greater than or less than symbols