test/java/lang/Math/HypotTests.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 27,37 ****
* @summary Tests for {Math, StrictMath}.hypot
* @author Joseph D. Darcy
*/
import sun.misc.DoubleConsts;
- import sun.misc.FpUtils;
public class HypotTests {
private HypotTests(){}
static final double infinityD = Double.POSITIVE_INFINITY;
--- 27,36 ----
*** 125,135 ****
java.util.Random rand = new java.util.Random();
for(int i = 0; i < 1000; i++) {
double d = rand.nextDouble();
// Scale d to have an exponent equal to MAX_EXPONENT -15
d = Math.scalb(d, DoubleConsts.MAX_EXPONENT
! -15 - FpUtils.ilogb(d));
for(int j = 0; j <= 13; j += 1) {
failures += testHypotCase(3*d, 4*d, 5*d, 2.5);
d *= 2.0; // increase exponent by 1
}
}
--- 124,134 ----
java.util.Random rand = new java.util.Random();
for(int i = 0; i < 1000; i++) {
double d = rand.nextDouble();
// Scale d to have an exponent equal to MAX_EXPONENT -15
d = Math.scalb(d, DoubleConsts.MAX_EXPONENT
! -15 - Tests.ilogb(d));
for(int j = 0; j <= 13; j += 1) {
failures += testHypotCase(3*d, 4*d, 5*d, 2.5);
d *= 2.0; // increase exponent by 1
}
}