File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Random number problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Random number problem" Watch "Random number problem" New topic
Author

Random number problem

Adam Hansen
Greenhorn

Joined: Jul 15, 2003
Posts: 2
I have looked at all the other random number questions on the forum, and have yet to find something that relates to my case. How would I generate a random number between -1 and 1?
Thanks in advance.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Welcome to JavaRanch, Adam!
What you are looking for seems to be:

Hope this helps,


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Adam Hansen
Greenhorn

Joined: Jul 15, 2003
Posts: 2
Oh, my gosh. I can't believe I didn't see that before. Sometimes it is the simple math that causes the most trouble. Thanks much for the help!
 
 
subject: Random number problem
 
Similar Threads
Random Number
Random numbers
Three random numbers not working
Variables assigned to objects
no main method found