Skip to content
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

Fix #1671: Fix {Float,Double}.toInt for large abs values. #1676

Merged
merged 2 commits into from May 22, 2015

Commits on May 22, 2015

  1. Do not rely on .toInt's buggy behavior in our low-level algos.

    Some low-level algorithms in java.util.Random and
    scala.scalajs.runtime.Bits relied on the buggy behavior of
    (x: Double).toInt. This commit fixes this by explicitly using a
    `rawToInt` function that uses `x | 0` explicitly with js.Dynamic.
    sjrd committed May 22, 2015
    Copy the full SHA
    a7e168c View commit details
    Browse the repository at this point in the history
  2. Fix scala-js#1671: Fix {Float,Double}.toInt for large abs values.

    The behavior of ToInt32(x) in ES does not match the behavior of
    (int) x on the JVM for values that are lower than Int.MinValue
    or larger than Int.MaxValue. On the JVM, and hence for .toInt,
    they are clamped at Int.MinValue or Int.MaxValue, respectively.
    So we have to handle these cases separately.
    sjrd committed May 22, 2015
    Copy the full SHA
    507ca1c View commit details
    Browse the repository at this point in the history