Skip to content

ThreadLocalRandom.nextDouble(MinValue, MaxValue) returns Infinity. #2144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolasstucki opened this issue Jan 5, 2016 · 0 comments
Closed
Assignees
Labels
bug Confirmed bug. Needs to be fixed.
Milestone

Comments

@nicolasstucki
Copy link
Contributor

The issue is that Double.Infinity is not contained in the defined bounds.

This method is implemented with:

def nextDouble(least: Double, bound: Double): Double = {
  if (least >= bound)
    throw new IllegalArgumentException()
  nextDouble() * (bound - least) + least
}

where (bound - least) evaluates to Double.Infinity when parameters Double.MinValue, Double.MaxValue.

@nicolasstucki nicolasstucki added the bug Confirmed bug. Needs to be fixed. label Jan 5, 2016
@nicolasstucki nicolasstucki added this to the v0.6.6 milestone Jan 5, 2016
@nicolasstucki nicolasstucki self-assigned this Jan 5, 2016
nicolasstucki added a commit to nicolasstucki/scala-js that referenced this issue Jan 5, 2016
nicolasstucki added a commit to nicolasstucki/scala-js that referenced this issue Jan 6, 2016
nicolasstucki added a commit to nicolasstucki/scala-js that referenced this issue Jan 6, 2016
nicolasstucki added a commit to nicolasstucki/scala-js that referenced this issue Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug. Needs to be fixed.
Projects
None yet
Development

No branches or pull requests

1 participant