Skip to content

SleekPanther/java-math-improved-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Java Random() Improved

Improvements on the Math.random() method allowing you to specify:

  • An upper bound representing range (not just doubles between 0 & 1)
  • A lower bound

Double Functions

Upper bound is always excluded

  • random()
    Returns a double between 0 and 1
  • random(double upperBound)
    Returns a double between 0 and upperBound
  • random(double lowerBound, double upperBound) Returns a doublebetweenlowerBoundandupperBound`

Integer Functions randInt()

  • randInt()
    Returns an integer between 0 and Integer.MAX_VALUE (like Random class nextInt() )
  • randInt(int upperBound)
    Returns an integer between 0 and upperBound
    EXCLUDING upperBound
  • randInt(int lowerBound, int upperBound)
    Returns an integer between lowerBound and upperBound
    INCLUDING upperBound

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages