{"action":"created","issue":{"url":"https://api.github.com/repos/scala-js/scala-js/issues/2678","repository_url":"https://api.github.com/repos/scala-js/scala-js","labels_url":"https://api.github.com/repos/scala-js/scala-js/issues/2678/labels{/name}","comments_url":"https://api.github.com/repos/scala-js/scala-js/issues/2678/comments","events_url":"https://api.github.com/repos/scala-js/scala-js/issues/2678/events","html_url":"https://github.com/scala-js/scala-js/pull/2678","id":194181468,"number":2678,"title":"Add test cases for BigDecimal.setScale w/rounding","user":{"login":"er1c","id":64685,"avatar_url":"https://avatars.githubusercontent.com/u/64685?v=3","gravatar_id":"","url":"https://api.github.com/users/er1c","html_url":"https://github.com/er1c","followers_url":"https://api.github.com/users/er1c/followers","following_url":"https://api.github.com/users/er1c/following{/other_user}","gists_url":"https://api.github.com/users/er1c/gists{/gist_id}","starred_url":"https://api.github.com/users/er1c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/er1c/subscriptions","organizations_url":"https://api.github.com/users/er1c/orgs","repos_url":"https://api.github.com/users/er1c/repos","events_url":"https://api.github.com/users/er1c/events{/privacy}","received_events_url":"https://api.github.com/users/er1c/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-07T21:53:17Z","updated_at":"2016-12-08T20:06:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scala-js/scala-js/pulls/2678","html_url":"https://github.com/scala-js/scala-js/pull/2678","diff_url":"https://github.com/scala-js/scala-js/pull/2678.diff","patch_url":"https://github.com/scala-js/scala-js/pull/2678.patch"},"body":"I haven't found the fix yet, but there appears to be a bug in the java.math.BigDecimal implementation... when `0 < n > 1`, adding a few test cases to reproduce it.\r\n\r\nThese all compare fine on the JVM:\r\n\r\n```\r\n@ BigDecimal.ONE.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_UP))\r\nres464: Int = 0\r\n@ BigDecimal.ZERO.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_DOWN))\r\nres465: Int = 0\r\n@ BigDecimal.ONE.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_CEILING))\r\nres466: Int = 0\r\n@ BigDecimal.ZERO.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_FLOOR))\r\nres467: Int = 0\r\n@ BigDecimal.ONE.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_HALF_UP))\r\nres468: Int = 0\r\n@ BigDecimal.ZERO.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_HALF_DOWN))\r\nres469: Int = 0\r\n@ BigDecimal.ZERO.compareTo(BigDecimal.valueOf(0.5).setScale(0, BigDecimal.ROUND_HALF_EVEN))\r\nres470: Int = 0\r\n```"},"comment":{"url":"https://api.github.com/repos/scala-js/scala-js/issues/comments/265841085","html_url":"https://github.com/scala-js/scala-js/pull/2678#issuecomment-265841085","issue_url":"https://api.github.com/repos/scala-js/scala-js/issues/2678","id":265841085,"user":{"login":"er1c","id":64685,"avatar_url":"https://avatars.githubusercontent.com/u/64685?v=3","gravatar_id":"","url":"https://api.github.com/users/er1c","html_url":"https://github.com/er1c","followers_url":"https://api.github.com/users/er1c/followers","following_url":"https://api.github.com/users/er1c/following{/other_user}","gists_url":"https://api.github.com/users/er1c/gists{/gist_id}","starred_url":"https://api.github.com/users/er1c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/er1c/subscriptions","organizations_url":"https://api.github.com/users/er1c/orgs","repos_url":"https://api.github.com/users/er1c/repos","events_url":"https://api.github.com/users/er1c/events{/privacy}","received_events_url":"https://api.github.com/users/er1c/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T20:06:26Z","updated_at":"2016-12-08T20:06:26Z","body":"PR Updated, I added a BigDecimal.movePointRight test that also fails in scala.js too"}}
{"actor":{"display_login":"er1c"}}