File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Programmer Certification (SCJP/OCPJP)
Random Number from Math
Joined: May 29, 2000
Jun 19, 2000 21:22:00
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,
Joined: Nov 22, 2008
Jun 19, 2000 21:40:00
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."
Joined: Jun 18, 2000
Jun 19, 2000 23:58:00
I agree. Here's the link:
subject: Random Number from Math
Generating Random Number
extremes of Math.ceil
greater than or less than symbols
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015