Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
693e17db
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
693e17db
编写于
7月 17, 2011
作者:
D
darcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7062430: Minor inconsistency in ulp descriptions
Reviewed-by: smarks, alanb
上级
1c66abe1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
48 addition
and
48 deletion
+48
-48
src/share/classes/java/lang/Math.java
src/share/classes/java/lang/Math.java
+38
-38
src/share/classes/java/lang/StrictMath.java
src/share/classes/java/lang/StrictMath.java
+10
-10
未找到文件。
src/share/classes/java/lang/Math.java
浏览文件 @
693e17db
...
...
@@ -50,34 +50,34 @@ import java.util.Random;
*
* <p>The quality of implementation specifications concern two
* properties, accuracy of the returned result and monotonicity of the
* method. Accuracy of the floating-point {@code Math} methods
*
is measured in terms of <i>ulps</i>, units in the last place. For
*
a given floating-point format, an ulp of a specific real number
*
value is the distance between the two floating-point values
*
bracketing that numerical value. When discussing the accuracy of a
*
method as a whole rather than at a specific argument, the number of
*
ulps cited is for the worst-case error at any argument. If a
*
method always has an error less than 0.5 ulps, the method always
*
returns the floating-point number nearest the exact result; such a
*
method is <i>correctly rounded</i>. A correctly rounded method is
*
generally the best a floating-point approximation can be; however,
*
it is impractical for many floating-point methods to be correctly
*
rounded. Instead, for the {@code Math} class, a larger err
or
*
bound of 1 or 2 ulps is allowed for certain methods. Informally,
*
with a 1 ulp error bound, when the exact result is a representable
*
number, the exact result should be returned as the computed result;
*
otherwise, either of the two floating-point values which bracket
* t
he exact result may be returned. For exact results large in
*
magnitude, one of the endpoints of the bracket may be infinite.
*
Besides accuracy at individual arguments, maintaining proper
*
relations between the method at different arguments is also
*
important. Therefore, most methods with more than 0.5 ulp errors
*
are required to be <i>semi-monotonic</i>: whenever the mathematical
*
function is non-decreasing, so is the floating-point approximation,
*
likewise, whenever the mathematical function is non-increasing, so
*
is the floating-point approximation. Not all approximations that
*
have 1 ulp accuracy will automatically meet the monotonicity
* requirements.
* method. Accuracy of the floating-point {@code Math} methods
is
*
measured in terms of <i>ulps</i>, units in the last place. For a
*
given floating-point format, an {@linkplain #ulp(double) ulp} of a
*
specific real number value is the distance between the two
*
floating-point values bracketing that numerical value. When
*
discussing the accuracy of a method as a whole rather than at a
*
specific argument, the number of ulps cited is for the worst-case
*
error at any argument. If a method always has an error less than
*
0.5 ulps, the method always returns the floating-point number
*
nearest the exact result; such a method is <i>correctly
*
rounded</i>. A correctly rounded method is generally the best a
*
floating-point approximation can be; however, it is impractical for
*
many floating-point methods to be correctly rounded. Instead, f
or
*
the {@code Math} class, a larger error bound of 1 or 2 ulps is
*
allowed for certain methods. Informally, with a 1 ulp error bound,
*
when the exact result is a representable number, the exact result
*
should be returned as the computed result; otherwise, either of the
* t
wo floating-point values which bracket the exact result may be
*
returned. For exact results large in magnitude, one of the
*
endpoints of the bracket may be infinite. Besides accuracy at
*
individual arguments, maintaining proper relations between the
*
method at different arguments is also important. Therefore, most
*
methods with more than 0.5 ulp errors are required to be
*
<i>semi-monotonic</i>: whenever the mathematical function is
*
non-decreasing, so is the floating-point approximation, likewise,
*
whenever the mathematical function is non-increasing, so is the
*
floating-point approximation. Not all approximations that have 1
*
ulp accuracy will automatically meet the monotonicity
requirements.
*
* @author unascribed
* @author Joseph D. Darcy
...
...
@@ -940,11 +940,11 @@ public final class Math {
}
/**
* Returns the size of an ulp of the argument. An ulp
of a
*
{@code double} value is the positive distance between this
*
floating-point value and the {@code double} value next
*
larger in magnitude. Note that for non-NaN <i>x</i>,
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* Returns the size of an ulp of the argument. An ulp
, unit in
*
the last place, of a {@code double} value is the positive
*
distance between this floating-point value and the {@code
*
double} value next larger in magnitude. Note that for non-NaN
* <
i>x</i>, <
code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
...
...
@@ -967,11 +967,11 @@ public final class Math {
}
/**
* Returns the size of an ulp of the argument. An ulp
of a
*
{@code float} value is the positive distance between this
*
floating-point value and the {@code float} value next
*
larger in magnitude. Note that for non-NaN <i>x</i>,
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* Returns the size of an ulp of the argument. An ulp
, unit in
*
the last place, of a {@code float} value is the positive
*
distance between this floating-point value and the {@code
*
float} value next larger in magnitude. Note that for non-NaN
* <
i>x</i>, <
code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
...
...
src/share/classes/java/lang/StrictMath.java
浏览文件 @
693e17db
...
...
@@ -932,11 +932,11 @@ public final class StrictMath {
}
/**
* Returns the size of an ulp of the argument. An ulp
of a
*
{@code double} value is the positive distance between this
*
floating-point value and the {@code double} value next
*
larger in magnitude. Note that for non-NaN <i>x</i>,
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* Returns the size of an ulp of the argument. An ulp
, unit in
*
the last place, of a {@code double} value is the positive
*
distance between this floating-point value and the {@code
*
double} value next larger in magnitude. Note that for non-NaN
* <
i>x</i>, <
code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
...
...
@@ -959,11 +959,11 @@ public final class StrictMath {
}
/**
* Returns the size of an ulp of the argument. An ulp
of a
*
{@code float} value is the positive distance between this
*
floating-point value and the {@code float} value next
*
larger in magnitude. Note that for non-NaN <i>x</i>,
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* Returns the size of an ulp of the argument. An ulp
, unit in
*
the last place, of a {@code float} value is the positive
*
distance between this floating-point value and the {@code
*
float} value next larger in magnitude. Note that for non-NaN
* <
i>x</i>, <
code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录