test/java/lang/Math/Rint.java
Print this page
*** 23,36 ****
/*
* @test
* @bug 4101566 4831589
* @summary Check for correct implementation of Math.rint(double)
*/
- import sun.misc.DoubleConsts;
-
public class Rint {
static int testRintCase(double input, double expected) {
int failures = 0;
double result;
--- 23,37 ----
/*
* @test
* @bug 4101566 4831589
* @summary Check for correct implementation of Math.rint(double)
+ * @library /lib/testlibrary
+ * @build jdk.testlibrary.DoubleUtils jdk.testlibrary.FloatUtils
+ * @run main Rint
*/
public class Rint {
static int testRintCase(double input, double expected) {
int failures = 0;
double result;
*** 49,60 ****
double twoToThe52 = Math.scalb(1.0, 52); // 2^52
double [][] testCases = {
{0.0, 0.0},
{Double.MIN_VALUE, 0.0},
! {Math.nextDown(DoubleConsts.MIN_NORMAL), 0.0},
! {DoubleConsts.MIN_NORMAL, 0.0},
{0.2, 0.0},
{Math.nextDown(0.5), 0.0},
{ 0.5, 0.0},
--- 50,61 ----
double twoToThe52 = Math.scalb(1.0, 52); // 2^52
double [][] testCases = {
{0.0, 0.0},
{Double.MIN_VALUE, 0.0},
! {Math.nextDown(Double.MIN_NORMAL), 0.0},
! {Double.MIN_NORMAL, 0.0},
{0.2, 0.0},
{Math.nextDown(0.5), 0.0},
{ 0.5, 0.0},