Random

Bonjour,
je suis en train de chercher depuis 1 heure comment programmer la méthode random(x,y) si celle ci n'avait pas existé pour produire un réel aléatoire de [-1,1!! quelqu'un pouvait m'aider??
Configuration: Windows Vista
Safari 532.5

4 réponses

  1. intéressant à savoir pour moi aussi ...
    merci.
    0
    1. ce code affiche un float mais je ne sais pas ses bornes min max :
      public class unmoinsun {

      public static void main(String args[]) {
      Random rand = new Random();
      float x = rand.nextInt();
      System.out.println(x);
      }
      }
      0