Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8098907

Creating Random Number for a range of Float Values

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • None
    • javafx

      I am creating an application using JavaFx.In this application I want to create random numbers that for a range of 0.0-2.0.I am not able to do this because javafx.util.Math.random() returns only double values of range 0.0 - 1.0.If I use a scaling factor to increase the range, the uniform distribution of Random Numbers is lost, and this affects my entire application.

      So I want to request a new feature for generating Random values in Float for a given specific range.I find this feature will be very useful in JavaFX,as we can use them to make objects move randomly in the screen and it will be very useful in case of Gaming Applications.

      In Java there is a method java.util.Random.nextInt(int) which allows user to specify the end value and returns an Integer,which is also not available in JavaFX.This feature can be inherited from Java.

      These features will help in easy development of the applications.

            kcr Kevin Rushforth
            djagadeesjfx Dwarakanath Jagadeesan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: