Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
b80f5552
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b80f5552
编写于
13年前
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7092404: Add Math.nextDown and Double.isFinite
Reviewed-by: mduigou
上级
299cf0f0
变更
36
隐藏空白更改
内联
并排
Showing
36 changed file
with
269 addition
and
142 deletion
+269
-142
jdk/src/share/classes/java/lang/Double.java
jdk/src/share/classes/java/lang/Double.java
+17
-3
jdk/src/share/classes/java/lang/Float.java
jdk/src/share/classes/java/lang/Float.java
+17
-2
jdk/src/share/classes/java/lang/Math.java
jdk/src/share/classes/java/lang/Math.java
+73
-0
jdk/src/share/classes/java/lang/StrictMath.java
jdk/src/share/classes/java/lang/StrictMath.java
+58
-0
jdk/src/share/classes/java/util/Formatter.java
jdk/src/share/classes/java/util/Formatter.java
+1
-2
jdk/src/share/classes/sun/misc/FpUtils.java
jdk/src/share/classes/sun/misc/FpUtils.java
+12
-20
jdk/test/java/lang/Double/ParseHexFloatingPoint.java
jdk/test/java/lang/Double/ParseHexFloatingPoint.java
+8
-9
jdk/test/java/lang/Math/CeilAndFloorTests.java
jdk/test/java/lang/Math/CeilAndFloorTests.java
+11
-12
jdk/test/java/lang/Math/CubeRootTests.java
jdk/test/java/lang/Math/CubeRootTests.java
+5
-6
jdk/test/java/lang/Math/Expm1Tests.java
jdk/test/java/lang/Math/Expm1Tests.java
+3
-4
jdk/test/java/lang/Math/HyperbolicTests.java
jdk/test/java/lang/Math/HyperbolicTests.java
+3
-4
jdk/test/java/lang/Math/HypotTests.java
jdk/test/java/lang/Math/HypotTests.java
+3
-3
jdk/test/java/lang/Math/IeeeRecommendedTests.java
jdk/test/java/lang/Math/IeeeRecommendedTests.java
+15
-9
jdk/test/java/lang/Math/Log10Tests.java
jdk/test/java/lang/Math/Log10Tests.java
+6
-7
jdk/test/java/lang/Math/Log1pTests.java
jdk/test/java/lang/Math/Log1pTests.java
+3
-4
jdk/test/java/lang/Math/Rint.java
jdk/test/java/lang/Math/Rint.java
+10
-13
jdk/test/java/util/Formatter/Basic-X.java.template
jdk/test/java/util/Formatter/Basic-X.java.template
+3
-4
jdk/test/java/util/Formatter/BasicBigDecimal.java
jdk/test/java/util/Formatter/BasicBigDecimal.java
+1
-2
jdk/test/java/util/Formatter/BasicBigInteger.java
jdk/test/java/util/Formatter/BasicBigInteger.java
+1
-2
jdk/test/java/util/Formatter/BasicBoolean.java
jdk/test/java/util/Formatter/BasicBoolean.java
+1
-2
jdk/test/java/util/Formatter/BasicBooleanObject.java
jdk/test/java/util/Formatter/BasicBooleanObject.java
+1
-2
jdk/test/java/util/Formatter/BasicByte.java
jdk/test/java/util/Formatter/BasicByte.java
+1
-2
jdk/test/java/util/Formatter/BasicByteObject.java
jdk/test/java/util/Formatter/BasicByteObject.java
+1
-2
jdk/test/java/util/Formatter/BasicChar.java
jdk/test/java/util/Formatter/BasicChar.java
+1
-2
jdk/test/java/util/Formatter/BasicCharObject.java
jdk/test/java/util/Formatter/BasicCharObject.java
+1
-2
jdk/test/java/util/Formatter/BasicDateTime.java
jdk/test/java/util/Formatter/BasicDateTime.java
+1
-2
jdk/test/java/util/Formatter/BasicDouble.java
jdk/test/java/util/Formatter/BasicDouble.java
+3
-4
jdk/test/java/util/Formatter/BasicDoubleObject.java
jdk/test/java/util/Formatter/BasicDoubleObject.java
+1
-2
jdk/test/java/util/Formatter/BasicFloat.java
jdk/test/java/util/Formatter/BasicFloat.java
+1
-2
jdk/test/java/util/Formatter/BasicFloatObject.java
jdk/test/java/util/Formatter/BasicFloatObject.java
+1
-2
jdk/test/java/util/Formatter/BasicInt.java
jdk/test/java/util/Formatter/BasicInt.java
+1
-2
jdk/test/java/util/Formatter/BasicIntObject.java
jdk/test/java/util/Formatter/BasicIntObject.java
+1
-2
jdk/test/java/util/Formatter/BasicLong.java
jdk/test/java/util/Formatter/BasicLong.java
+1
-2
jdk/test/java/util/Formatter/BasicLongObject.java
jdk/test/java/util/Formatter/BasicLongObject.java
+1
-2
jdk/test/java/util/Formatter/BasicShort.java
jdk/test/java/util/Formatter/BasicShort.java
+1
-2
jdk/test/java/util/Formatter/BasicShortObject.java
jdk/test/java/util/Formatter/BasicShortObject.java
+1
-2
未找到文件。
jdk/src/share/classes/java/lang/Double.java
浏览文件 @
b80f5552
...
...
@@ -276,7 +276,7 @@ public final class Double extends Number implements Comparable<Double> {
* 7.19.6.1; however, the output of this method is more
* tightly specified.
*/
if
(!
FpUtils
.
isFinite
(
d
)
)
if
(!
isFinite
(
d
)
)
// For infinity and NaN, use the decimal output.
return
Double
.
toString
(
d
);
else
{
...
...
@@ -548,7 +548,7 @@ public final class Double extends Number implements Comparable<Double> {
* @return {@code true} if the value of the argument is NaN;
* {@code false} otherwise.
*/
static
publ
ic
boolean
isNaN
(
double
v
)
{
public
stat
ic
boolean
isNaN
(
double
v
)
{
return
(
v
!=
v
);
}
...
...
@@ -560,10 +560,24 @@ public final class Double extends Number implements Comparable<Double> {
* @return {@code true} if the value of the argument is positive
* infinity or negative infinity; {@code false} otherwise.
*/
static
publ
ic
boolean
isInfinite
(
double
v
)
{
public
stat
ic
boolean
isInfinite
(
double
v
)
{
return
(
v
==
POSITIVE_INFINITY
)
||
(
v
==
NEGATIVE_INFINITY
);
}
/**
* Returns {@code true} if the argument is a finite floating-point
* value; returns {@code false} otherwise (for NaN and infinity
* arguments).
*
* @param d the {@code double} value to be tested
* @return {@code true} if the argument is a finite
* floating-point value, {@code false} otherwise.
* @since 1.8
*/
public
static
boolean
isFinite
(
double
d
)
{
return
Math
.
abs
(
d
)
<=
DoubleConsts
.
MAX_VALUE
;
}
/**
* The value of the Double.
*
...
...
This diff is collapsed.
Click to expand it.
jdk/src/share/classes/java/lang/Float.java
浏览文件 @
b80f5552
...
...
@@ -459,7 +459,7 @@ public final class Float extends Number implements Comparable<Float> {
* @return {@code true} if the argument is NaN;
* {@code false} otherwise.
*/
static
publ
ic
boolean
isNaN
(
float
v
)
{
public
stat
ic
boolean
isNaN
(
float
v
)
{
return
(
v
!=
v
);
}
...
...
@@ -471,10 +471,25 @@ public final class Float extends Number implements Comparable<Float> {
* @return {@code true} if the argument is positive infinity or
* negative infinity; {@code false} otherwise.
*/
static
publ
ic
boolean
isInfinite
(
float
v
)
{
public
stat
ic
boolean
isInfinite
(
float
v
)
{
return
(
v
==
POSITIVE_INFINITY
)
||
(
v
==
NEGATIVE_INFINITY
);
}
/**
* Returns {@code true} if the argument is a finite floating-point
* value; returns {@code false} otherwise (for NaN and infinity
* arguments).
*
* @param f the {@code float} value to be tested
* @return {@code true} if the argument is a finite
* floating-point value, {@code false} otherwise.
* @since 1.8
*/
public
static
boolean
isFinite
(
float
f
)
{
return
Math
.
abs
(
f
)
<=
FloatConsts
.
MAX_VALUE
;
}
/**
* The value of the Float.
*
...
...
This diff is collapsed.
Click to expand it.
jdk/src/share/classes/java/lang/Math.java
浏览文件 @
b80f5552
...
...
@@ -1649,6 +1649,79 @@ public final class Math {
}
}
/**
* Returns the floating-point value adjacent to {@code d} in
* the direction of negative infinity. This method is
* semantically equivalent to {@code nextAfter(d,
* Double.NEGATIVE_INFINITY)}; however, a
* {@code nextDown} implementation may run faster than its
* equivalent {@code nextAfter} call.
*
* <p>Special Cases:
* <ul>
* <li> If the argument is NaN, the result is NaN.
*
* <li> If the argument is negative infinity, the result is
* negative infinity.
*
* <li> If the argument is zero, the result is
* {@code -Double.MIN_VALUE}
*
* </ul>
*
* @param d starting floating-point value
* @return The adjacent floating-point value closer to negative
* infinity.
* @since 1.8
*/
public
static
double
nextDown
(
double
d
)
{
if
(
Double
.
isNaN
(
d
)
||
d
==
Double
.
NEGATIVE_INFINITY
)
return
d
;
else
{
if
(
d
==
0.0
)
return
-
Double
.
MIN_VALUE
;
else
return
Double
.
longBitsToDouble
(
Double
.
doubleToRawLongBits
(
d
)
+
((
d
>
0.0d
)?-
1L
:+
1L
));
}
}
/**
* Returns the floating-point value adjacent to {@code f} in
* the direction of negative infinity. This method is
* semantically equivalent to {@code nextAfter(f,
* Float.NEGATIVE_INFINITY)}; however, a
* {@code nextDown} implementation may run faster than its
* equivalent {@code nextAfter} call.
*
* <p>Special Cases:
* <ul>
* <li> If the argument is NaN, the result is NaN.
*
* <li> If the argument is negative infinity, the result is
* negative infinity.
*
* <li> If the argument is zero, the result is
* {@code -Float.MIN_VALUE}
*
* </ul>
*
* @param f starting floating-point value
* @return The adjacent floating-point value closer to negative
* infinity.
* @since 1.8
*/
public
static
float
nextDown
(
float
f
)
{
if
(
Float
.
isNaN
(
f
)
||
f
==
Float
.
NEGATIVE_INFINITY
)
return
f
;
else
{
if
(
f
==
0.0f
)
return
-
Float
.
MIN_VALUE
;
else
return
Float
.
intBitsToFloat
(
Float
.
floatToRawIntBits
(
f
)
+
((
f
>
0.0f
)?-
1
:+
1
));
}
}
/**
* Return {@code d} ×
...
...
This diff is collapsed.
Click to expand it.
jdk/src/share/classes/java/lang/StrictMath.java
浏览文件 @
b80f5552
...
...
@@ -1396,6 +1396,64 @@ public final class StrictMath {
return
Math
.
nextUp
(
f
);
}
/**
* Returns the floating-point value adjacent to {@code d} in
* the direction of negative infinity. This method is
* semantically equivalent to {@code nextAfter(d,
* Double.NEGATIVE_INFINITY)}; however, a
* {@code nextDown} implementation may run faster than its
* equivalent {@code nextAfter} call.
*
* <p>Special Cases:
* <ul>
* <li> If the argument is NaN, the result is NaN.
*
* <li> If the argument is negative infinity, the result is
* negative infinity.
*
* <li> If the argument is zero, the result is
* {@code -Double.MIN_VALUE}
*
* </ul>
*
* @param d starting floating-point value
* @return The adjacent floating-point value closer to negative
* infinity.
* @since 1.8
*/
public
static
double
nextDown
(
double
d
)
{
return
Math
.
nextDown
(
d
);
}
/**
* Returns the floating-point value adjacent to {@code f} in
* the direction of negative infinity. This method is
* semantically equivalent to {@code nextAfter(f,
* Float.NEGATIVE_INFINITY)}; however, a
* {@code nextDown} implementation may run faster than its
* equivalent {@code nextAfter} call.
*
* <p>Special Cases:
* <ul>
* <li> If the argument is NaN, the result is NaN.
*
* <li> If the argument is negative infinity, the result is
* negative infinity.
*
* <li> If the argument is zero, the result is
* {@code -Float.MIN_VALUE}
*
* </ul>
*
* @param f starting floating-point value
* @return The adjacent floating-point value closer to negative
* infinity.
* @since 1.8
*/
public
static
float
nextDown
(
float
f
)
{
return
Math
.
nextDown
(
f
);
}
/**
* Return {@code d} ×
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
...
...
This diff is collapsed.
Click to expand it.
jdk/src/share/classes/java/util/Formatter.java
浏览文件 @
b80f5552
...
...
@@ -50,7 +50,6 @@ import java.text.NumberFormat;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
import
sun.misc.FormattedFloatingDecimal
;
...
...
@@ -3417,7 +3416,7 @@ public final class Formatter implements Closeable, Flushable {
// Method assumes that d > 0.
private
String
hexDouble
(
double
d
,
int
prec
)
{
// Let Double.toHexString handle simple cases
if
(!
FpUtils
.
isFinite
(
d
)
||
d
==
0.0
||
prec
==
0
||
prec
>=
13
)
if
(!
Double
.
isFinite
(
d
)
||
d
==
0.0
||
prec
==
0
||
prec
>=
13
)
// remove "0x"
return
Double
.
toHexString
(
d
).
substring
(
2
);
else
{
...
...
This diff is collapsed.
Click to expand it.
jdk/src/share/classes/sun/misc/FpUtils.java
浏览文件 @
b80f5552
...
...
@@ -202,9 +202,11 @@ public class FpUtils {
* @param d the {@code double} value to be tested
* @return {@code true} if the argument is a finite
* floating-point value, {@code false} otherwise.
* @deprecated Use Double.isFinite.
*/
@Deprecated
public
static
boolean
isFinite
(
double
d
)
{
return
Math
.
abs
(
d
)
<=
DoubleConsts
.
MAX_VALUE
;
return
Double
.
isFinite
(
d
)
;
}
/**
...
...
@@ -215,9 +217,11 @@ public class FpUtils {
* @param f the {@code float} value to be tested
* @return {@code true} if the argument is a finite
* floating-point value, {@code false} otherwise.
* @deprecated Use Float.isFinite.
*/
@Deprecated
public
static
boolean
isFinite
(
float
f
)
{
return
Math
.
abs
(
f
)
<=
FloatConsts
.
MAX_VALUE
;
return
Float
.
isFinite
(
f
)
;
}
/**
...
...
@@ -746,17 +750,11 @@ public class FpUtils {
* @return The adjacent floating-point value closer to negative
* infinity.
* @author Joseph D. Darcy
* @deprecated Use Math.nextDown.
*/
@Deprecated
public
static
double
nextDown
(
double
d
)
{
if
(
isNaN
(
d
)
||
d
==
Double
.
NEGATIVE_INFINITY
)
return
d
;
else
{
if
(
d
==
0.0
)
return
-
Double
.
MIN_VALUE
;
else
return
Double
.
longBitsToDouble
(
Double
.
doubleToRawLongBits
(
d
)
+
((
d
>
0.0d
)?-
1L
:+
1L
));
}
return
Math
.
nextDown
(
d
);
}
/**
...
...
@@ -783,17 +781,11 @@ public class FpUtils {
* @return The adjacent floating-point value closer to negative
* infinity.
* @author Joseph D. Darcy
* @deprecated Use Math.nextDown.
*/
@Deprecated
public
static
double
nextDown
(
float
f
)
{
if
(
isNaN
(
f
)
||
f
==
Float
.
NEGATIVE_INFINITY
)
return
f
;
else
{
if
(
f
==
0.0f
)
return
-
Float
.
MIN_VALUE
;
else
return
Float
.
intBitsToFloat
(
Float
.
floatToRawIntBits
(
f
)
+
((
f
>
0.0f
)?-
1
:+
1
));
}
return
Math
.
nextDown
(
f
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Double/ParseHexFloatingPoint.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -30,7 +30,6 @@
import
java.util.regex.*
;
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
public
class
ParseHexFloatingPoint
{
...
...
@@ -227,7 +226,7 @@ public class ParseHexFloatingPoint {
new
PairSD
(
"0x1.000000000000001p-1075"
,
Double
.
MIN_VALUE
),
// More subnormal rounding tests
new
PairSD
(
"0x0.fffffffffffff7fffffp-1022"
,
FpUtils
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
)),
new
PairSD
(
"0x0.fffffffffffff7fffffp-1022"
,
Math
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
)),
new
PairSD
(
"0x0.fffffffffffff8p-1022"
,
DoubleConsts
.
MIN_NORMAL
),
new
PairSD
(
"0x0.fffffffffffff800000001p-1022"
,
DoubleConsts
.
MIN_NORMAL
),
new
PairSD
(
"0x0.fffffffffffff80000000000000001p-1022"
,
DoubleConsts
.
MIN_NORMAL
),
...
...
@@ -242,10 +241,10 @@ public class ParseHexFloatingPoint {
new
PairSD
(
"0x1.fffffffffffff8p1023"
,
infinityD
),
new
PairSD
(
"0x1.fffffffffffff8000001p1023"
,
infinityD
),
new
PairSD
(
"0x1.ffffffffffffep1023"
,
FpUtils
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffe0000p1023"
,
FpUtils
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffe8p1023"
,
FpUtils
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffe7p1023"
,
FpUtils
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffep1023"
,
Math
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffe0000p1023"
,
Math
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffe8p1023"
,
Math
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffe7p1023"
,
Math
.
nextDown
(
Double
.
MAX_VALUE
)),
new
PairSD
(
"0x1.ffffffffffffeffffffp1023"
,
Double
.
MAX_VALUE
),
new
PairSD
(
"0x1.ffffffffffffe8000001p1023"
,
Double
.
MAX_VALUE
),
};
...
...
@@ -284,8 +283,8 @@ public class ParseHexFloatingPoint {
};
double
[]
answers
=
{
FpUtils
.
nextDown
(
FpUtils
.
nextDown
(
2.0
)),
FpUtils
.
nextDown
(
2.0
),
Math
.
nextDown
(
Math
.
nextDown
(
2.0
)),
Math
.
nextDown
(
2.0
),
2.0
};
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/CeilAndFloorTests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009,
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
...
...
@@ -27,7 +27,6 @@
* @summary Check for correct implementation of Math.ceil and Math.floor
*/
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
public
class
CeilAndFloorTests
{
...
...
@@ -69,7 +68,7 @@ public class CeilAndFloorTests {
for
(
int
i
=
Double
.
MIN_EXPONENT
;
i
<=
Double
.
MAX_EXPONENT
;
i
++)
{
double
powerOfTwo
=
Math
.
scalb
(
1.0
,
i
);
double
neighborDown
=
FpUtils
.
nextDown
(
powerOfTwo
);
double
neighborDown
=
Math
.
nextDown
(
powerOfTwo
);
double
neighborUp
=
Math
.
nextUp
(
powerOfTwo
);
if
(
i
<
0
)
{
...
...
@@ -114,7 +113,7 @@ public class CeilAndFloorTests {
for
(
int
i
=
-(
0x10000
);
i
<=
0x10000
;
i
++)
{
double
d
=
(
double
)
i
;
double
neighborDown
=
FpUtils
.
nextDown
(
d
);
double
neighborDown
=
Math
.
nextDown
(
d
);
double
neighborUp
=
Math
.
nextUp
(
d
);
failures
+=
testCeilCase
(
d
,
d
);
...
...
@@ -140,8 +139,8 @@ public class CeilAndFloorTests {
double
[][]
testCases
=
{
{
Double
.
MIN_VALUE
,
1.0
},
{-
Double
.
MIN_VALUE
,
-
0.0
},
{
FpUtils
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
),
1.0
},
{-
FpUtils
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
),
-
0.0
},
{
Math
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
),
1.0
},
{-
Math
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
),
-
0.0
},
{
DoubleConsts
.
MIN_NORMAL
,
1.0
},
{-
DoubleConsts
.
MIN_NORMAL
,
-
0.0
},
...
...
@@ -157,8 +156,8 @@ public class CeilAndFloorTests {
{
2.5
,
3.0
},
{-
2.5
,
-
2.0
},
{
FpUtils
.
nextDown
(
1.0
),
1.0
},
{
FpUtils
.
nextDown
(-
1.0
),
-
1.0
},
{
Math
.
nextDown
(
1.0
),
1.0
},
{
Math
.
nextDown
(-
1.0
),
-
1.0
},
{
Math
.
nextUp
(
1.0
),
2.0
},
{
Math
.
nextUp
(-
1.0
),
-
0.0
},
...
...
@@ -166,17 +165,17 @@ public class CeilAndFloorTests {
{
0x1
.
0
p51
,
0x1
.
0
p51
},
{-
0x1
.
0
p51
,
-
0x1
.
0
p51
},
{
FpUtils
.
nextDown
(
0x1
.
0
p51
),
0x1
.
0
p51
},
{
Math
.
nextDown
(
0x1
.
0
p51
),
0x1
.
0
p51
},
{-
Math
.
nextUp
(
0x1
.
0
p51
),
-
0x1
.
0
p51
},
{
Math
.
nextUp
(
0x1
.
0
p51
),
0x1
.
0
p51
+
1
},
{-
FpUtils
.
nextDown
(
0x1
.
0
p51
),
-
0x1
.
0
p51
+
1
},
{-
Math
.
nextDown
(
0x1
.
0
p51
),
-
0x1
.
0
p51
+
1
},
{
FpUtils
.
nextDown
(
0x1
.
0
p52
),
0x1
.
0
p52
},
{
Math
.
nextDown
(
0x1
.
0
p52
),
0x1
.
0
p52
},
{-
Math
.
nextUp
(
0x1
.
0
p52
),
-
0x1
.
0
p52
-
1.0
},
{
Math
.
nextUp
(
0x1
.
0
p52
),
0x1
.
0
p52
+
1.0
},
{-
FpUtils
.
nextDown
(
0x1
.
0
p52
),
-
0x1
.
0
p52
+
1.0
},
{-
Math
.
nextDown
(
0x1
.
0
p52
),
-
0x1
.
0
p52
+
1.0
},
};
for
(
double
[]
testCase
:
testCases
)
{
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/CubeRootTests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -28,7 +28,6 @@
* @author Joseph D. Darcy
*/
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
public
class
CubeRootTests
{
...
...
@@ -245,8 +244,8 @@ public class CubeRootTests {
double
pc
=
Math
.
scalb
(
1.0
,
3
*
i
);
pcNeighbors
[
2
]
=
pc
;
pcNeighbors
[
1
]
=
FpUtils
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
FpUtils
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
1
]
=
Math
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
Math
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
3
]
=
Math
.
nextUp
(
pc
);
pcNeighbors
[
4
]
=
Math
.
nextUp
(
pcNeighbors
[
3
]);
...
...
@@ -284,8 +283,8 @@ public class CubeRootTests {
double
pc
=
Math
.
scalb
(
1.0
,
3
*
i
);
pcNeighbors
[
2
]
=
pc
;
pcNeighbors
[
1
]
=
FpUtils
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
FpUtils
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
1
]
=
Math
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
Math
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
3
]
=
Math
.
nextUp
(
pc
);
pcNeighbors
[
4
]
=
Math
.
nextUp
(
pcNeighbors
[
3
]);
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/Expm1Tests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -29,7 +29,6 @@
*/
import
sun.misc.DoubleConsts
;
import
sun.misc.FpUtils
;
/*
* The Taylor expansion of expxm1(x) = exp(x) -1 is
...
...
@@ -143,8 +142,8 @@ public class Expm1Tests {
double
pc
=
StrictMath
.
log
(
2
)*
i
;
pcNeighbors
[
2
]
=
pc
;
pcNeighbors
[
1
]
=
FpUtils
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
FpUtils
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
1
]
=
Math
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
Math
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
3
]
=
Math
.
nextUp
(
pc
);
pcNeighbors
[
4
]
=
Math
.
nextUp
(
pcNeighbors
[
3
]);
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/HyperbolicTests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -29,7 +29,6 @@
*/
import
sun.misc.DoubleConsts
;
import
sun.misc.FpUtils
;
public
class
HyperbolicTests
{
private
HyperbolicTests
(){}
...
...
@@ -280,7 +279,7 @@ public class HyperbolicTests {
long
trans22
=
Double
.
doubleToLongBits
(
22.0
);
// (approximately) largest value such that exp shouldn't
// overflow
long
transExpOvfl
=
Double
.
doubleToLongBits
(
FpUtils
.
nextDown
(
709.7827128933841
));
long
transExpOvfl
=
Double
.
doubleToLongBits
(
Math
.
nextDown
(
709.7827128933841
));
for
(
long
i
=
trans22
;
i
<
transExpOvfl
;
...
...
@@ -639,7 +638,7 @@ public class HyperbolicTests {
long
trans22
=
Double
.
doubleToLongBits
(
22.0
);
// (approximately) largest value such that exp shouldn't
// overflow
long
transExpOvfl
=
Double
.
doubleToLongBits
(
FpUtils
.
nextDown
(
709.7827128933841
));
long
transExpOvfl
=
Double
.
doubleToLongBits
(
Math
.
nextDown
(
709.7827128933841
));
for
(
long
i
=
trans22
;
i
<
transExpOvfl
;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/HypotTests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -156,8 +156,8 @@ public class HypotTests {
double
pc
=
Math
.
scalb
(
1.0
,
i
);
pcNeighbors
[
2
]
=
pc
;
pcNeighbors
[
1
]
=
FpUtils
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
FpUtils
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
1
]
=
Math
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
Math
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
3
]
=
Math
.
nextUp
(
pc
);
pcNeighbors
[
4
]
=
Math
.
nextUp
(
pcNeighbors
[
3
]);
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/IeeeRecommendedTests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
05
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -623,8 +623,11 @@ public class IeeeRecommendedTests {
};
for
(
int
i
=
0
;
i
<
testCases
.
length
;
i
++)
{
failures
+=
Tests
.
test
(
"FpUtils.nextDown(float)"
,
testCases
[
i
][
0
],
FpUtils
.
nextDown
(
testCases
[
i
][
0
]),
testCases
[
i
][
1
]);
failures
+=
Tests
.
test
(
"Math.nextDown(float)"
,
testCases
[
i
][
0
],
Math
.
nextDown
(
testCases
[
i
][
0
]),
testCases
[
i
][
1
]);
failures
+=
Tests
.
test
(
"StrictMath.nextDown(float)"
,
testCases
[
i
][
0
],
StrictMath
.
nextDown
(
testCases
[
i
][
0
]),
testCases
[
i
][
1
]);
}
return
failures
;
...
...
@@ -659,8 +662,11 @@ public class IeeeRecommendedTests {
};
for
(
int
i
=
0
;
i
<
testCases
.
length
;
i
++)
{
failures
+=
Tests
.
test
(
"FpUtils.nextDown(double)"
,
testCases
[
i
][
0
],
FpUtils
.
nextDown
(
testCases
[
i
][
0
]),
testCases
[
i
][
1
]);
failures
+=
Tests
.
test
(
"Math.nextDown(double)"
,
testCases
[
i
][
0
],
Math
.
nextDown
(
testCases
[
i
][
0
]),
testCases
[
i
][
1
]);
failures
+=
Tests
.
test
(
"StrictMath.nextDown(double)"
,
testCases
[
i
][
0
],
StrictMath
.
nextDown
(
testCases
[
i
][
0
]),
testCases
[
i
][
1
]);
}
return
failures
;
...
...
@@ -706,8 +712,8 @@ public class IeeeRecommendedTests {
FpUtils
.
isNaN
(
testCases
[
i
]),
(
i
==
0
));
// isFinite
failures
+=
Tests
.
test
(
"F
pUtils
.isFinite(float)"
,
testCases
[
i
],
F
pUtils
.
isFinite
(
testCases
[
i
]),
(
i
>=
3
));
failures
+=
Tests
.
test
(
"F
loat
.isFinite(float)"
,
testCases
[
i
],
F
loat
.
isFinite
(
testCases
[
i
]),
(
i
>=
3
));
// isInfinite
failures
+=
Tests
.
test
(
"FpUtils.isInfinite(float)"
,
testCases
[
i
],
...
...
@@ -756,8 +762,8 @@ public class IeeeRecommendedTests {
FpUtils
.
isNaN
(
testCases
[
i
]),
(
i
==
0
));
// isFinite
failures
+=
Tests
.
test
(
"
FpUtils
.isFinite(double)"
,
testCases
[
i
],
FpUtils
.
isFinite
(
testCases
[
i
]),
(
i
>=
3
));
failures
+=
Tests
.
test
(
"
Double
.isFinite(double)"
,
testCases
[
i
],
Double
.
isFinite
(
testCases
[
i
]),
(
i
>=
3
));
// isInfinite
failures
+=
Tests
.
test
(
"FpUtils.isInfinite(double)"
,
testCases
[
i
],
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/Log10Tests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -28,7 +28,6 @@
* @author Joseph D. Darcy
*/
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
public
class
Log10Tests
{
...
...
@@ -98,13 +97,13 @@ public class Log10Tests {
// within a few ulps of log(x)/log(10)
for
(
int
i
=
0
;
i
<
10000
;
i
++)
{
double
input
=
Double
.
longBitsToDouble
(
rand
.
nextLong
());
if
(!
FpUtils
.
isFinite
(
input
))
if
(!
Double
.
isFinite
(
input
))
continue
;
// avoid testing NaN and infinite values
else
{
input
=
Math
.
abs
(
input
);
double
expected
=
StrictMath
.
log
(
input
)/
LN_10
;
if
(
!
FpUtils
.
isFinite
(
expected
))
if
(
!
Double
.
isFinite
(
expected
))
continue
;
// if log(input) overflowed, try again
else
{
double
result
;
...
...
@@ -154,15 +153,15 @@ public class Log10Tests {
if
(
i
==
0
)
{
input
[
half
]
=
1.0
;
up
=
Math
.
nextUp
(
1.0
);
down
=
FpUtils
.
nextDown
(
1.0
);
down
=
Math
.
nextDown
(
1.0
);
}
else
{
input
[
half
+
i
]
=
up
;
input
[
half
-
i
]
=
down
;
up
=
Math
.
nextUp
(
up
);
down
=
FpUtils
.
nextDown
(
down
);
down
=
Math
.
nextDown
(
down
);
}
}
input
[
0
]
=
FpUtils
.
nextDown
(
input
[
1
]);
input
[
0
]
=
Math
.
nextDown
(
input
[
1
]);
for
(
int
i
=
0
;
i
<
neighbors
.
length
;
i
++)
{
neighbors
[
i
]
=
Math
.
log10
(
input
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/Log1pTests.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* 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
...
...
@@ -135,8 +135,8 @@ public class Log1pTests {
double
pc
=
StrictMath
.
pow
(
Math
.
E
,
i
)
-
1
;
pcNeighbors
[
2
]
=
pc
;
pcNeighbors
[
1
]
=
FpUtils
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
FpUtils
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
1
]
=
Math
.
nextDown
(
pc
);
pcNeighbors
[
0
]
=
Math
.
nextDown
(
pcNeighbors
[
1
]);
pcNeighbors
[
3
]
=
Math
.
nextUp
(
pc
);
pcNeighbors
[
4
]
=
Math
.
nextUp
(
pcNeighbors
[
3
]);
...
...
@@ -202,5 +202,4 @@ public class Log1pTests {
throw
new
RuntimeException
();
}
}
}
This diff is collapsed.
Click to expand it.
jdk/test/java/lang/Math/Rint.java
浏览文件 @
b80f5552
/*
* Copyright (c) 1998, 20
03
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 20
11
, 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
...
...
@@ -25,10 +25,8 @@
* @test
* @bug 4101566 4831589
* @summary Check for correct implementation of Math.rint(double)
*
*/
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
public
class
Rint
{
...
...
@@ -53,22 +51,22 @@ public class Rint {
double
[][]
testCases
=
{
{
0.0
,
0.0
},
{
Double
.
MIN_VALUE
,
0.0
},
{
FpUtils
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
),
0.0
},
{
Math
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
),
0.0
},
{
DoubleConsts
.
MIN_NORMAL
,
0.0
},
{
0.2
,
0.0
},
{
FpUtils
.
nextDown
(
0.5
),
0.0
},
{
0.5
,
0.0
},
{
Math
.
nextDown
(
0.5
),
0.0
},
{
0.5
,
0.0
},
{
Math
.
nextUp
(
0.5
),
1.0
},
{
0.7
,
1.0
},
{
FpUtils
.
nextDown
(
1.0
),
1.0
},
{
1.0
,
1.0
},
{
Math
.
nextDown
(
1.0
),
1.0
},
{
1.0
,
1.0
},
{
Math
.
nextUp
(
1.0
),
1.0
},
{
FpUtils
.
nextDown
(
1.5
),
1.0
},
{
1.5
,
2.0
},
{
Math
.
nextDown
(
1.5
),
1.0
},
{
1.5
,
2.0
},
{
Math
.
nextUp
(
1.5
),
2.0
},
{
4.2
,
4.0
},
...
...
@@ -82,7 +80,7 @@ public class Rint {
{
150000.75
,
150001.0
},
{
300000.5
,
300000.0
},
{
Math
.
nextUp
(
300000.5
),
300001.0
},
{
FpUtils
.
nextDown
(
300000.75
),
300001.0
},
{
Math
.
nextDown
(
300000.75
),
300001.0
},
{
300000.75
,
300001.0
},
{
Math
.
nextUp
(
300000.75
),
300001.0
},
{
300000.99
,
300001.0
},
...
...
@@ -91,7 +89,7 @@ public class Rint {
{
524287.75
,
524288.0
},
//(2^19 -1) + 0.75
{
524288.75
,
524289.0
},
{
FpUtils
.
nextDown
(
twoToThe52
),
twoToThe52
},
{
Math
.
nextDown
(
twoToThe52
),
twoToThe52
},
{
twoToThe52
,
twoToThe52
},
{
Math
.
nextUp
(
twoToThe52
),
Math
.
nextUp
(
twoToThe52
)},
...
...
@@ -118,5 +116,4 @@ public class Rint {
throw
new
RuntimeException
();
}
}
}
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/Basic-X.java.template
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -36,7 +36,6 @@ import java.math.BigInteger;
import java.text.DateFormatSymbols;
import java.util.*;
#if[double]
import sun.misc.FpUtils;
import sun.misc.DoubleConsts;
#end[double]
...
...
@@ -1301,9 +1300,9 @@ public class Basic$Type$ extends Basic {
test("%.11a", "0x1.00000000000p-1022", DoubleConsts.MIN_NORMAL);
test("%.1a", "0x1.0p-1022", DoubleConsts.MIN_NORMAL);
test("%.11a", "0x1.00000000000p-1022",
FpUtils
.nextDown(DoubleConsts.MIN_NORMAL));
Math
.nextDown(DoubleConsts.MIN_NORMAL));
test("%.1a", "0x1.0p-1022",
FpUtils
.nextDown(DoubleConsts.MIN_NORMAL));
Math
.nextDown(DoubleConsts.MIN_NORMAL));
test("%.11a", "0x1.ffffffffffep-1023",
Double.parseDouble("0x0.fffffffffffp-1022"));
test("%.1a", "0x1.0p-1022",
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicBigDecimal.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicBigInteger.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicBoolean.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicBooleanObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicByte.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicByteObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicChar.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicCharObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicDateTime.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
import
static
java
.
util
.
SimpleTimeZone
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicDouble.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -36,7 +36,6 @@ import java.math.BigInteger;
import
java.text.DateFormatSymbols
;
import
java.util.*
;
import
sun.misc.FpUtils
;
import
sun.misc.DoubleConsts
;
...
...
@@ -1301,9 +1300,9 @@ public class BasicDouble extends Basic {
test
(
"%.11a"
,
"0x1.00000000000p-1022"
,
DoubleConsts
.
MIN_NORMAL
);
test
(
"%.1a"
,
"0x1.0p-1022"
,
DoubleConsts
.
MIN_NORMAL
);
test
(
"%.11a"
,
"0x1.00000000000p-1022"
,
FpUtils
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
));
Math
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
));
test
(
"%.1a"
,
"0x1.0p-1022"
,
FpUtils
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
));
Math
.
nextDown
(
DoubleConsts
.
MIN_NORMAL
));
test
(
"%.11a"
,
"0x1.ffffffffffep-1023"
,
Double
.
parseDouble
(
"0x0.fffffffffffp-1022"
));
test
(
"%.1a"
,
"0x1.0p-1022"
,
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicDoubleObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicFloat.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicFloatObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicInt.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicIntObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicLong.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicLongObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicShort.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
jdk/test/java/util/Formatter/BasicShortObject.java
浏览文件 @
b80f5552
/*
* Copyright (c) 2003, 20
07
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
11
, 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
...
...
@@ -39,7 +39,6 @@ import java.util.*;
import
static
java
.
util
.
Calendar
.*;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
新手
引导
客服
返回
顶部