abouttr3

random method 1

Jul 8th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.18 KB | None | 0 0
  1.    public static double randomNegToPos1(double x){
  2.         double rand=Math.random()*x;
  3.         if(Math.random()<0.5){
  4.             rand*=-1;
  5.         }
  6.         return rand;
  7.     }
Advertisement
Add Comment
Please, Sign In to add comment