提交 693e17db 编写于 作者: D darcy

7062430: Minor inconsistency in ulp descriptions

Reviewed-by: smarks, alanb
上级 1c66abe1
...@@ -50,34 +50,34 @@ import java.util.Random; ...@@ -50,34 +50,34 @@ import java.util.Random;
* *
* <p>The quality of implementation specifications concern two * <p>The quality of implementation specifications concern two
* properties, accuracy of the returned result and monotonicity of the * properties, accuracy of the returned result and monotonicity of the
* method. Accuracy of the floating-point {@code Math} methods * method. Accuracy of the floating-point {@code Math} methods is
* is measured in terms of <i>ulps</i>, units in the last place. For * measured in terms of <i>ulps</i>, units in the last place. For a
* a given floating-point format, an ulp of a specific real number * given floating-point format, an {@linkplain #ulp(double) ulp} of a
* value is the distance between the two floating-point values * specific real number value is the distance between the two
* bracketing that numerical value. When discussing the accuracy of a * floating-point values bracketing that numerical value. When
* method as a whole rather than at a specific argument, the number of * discussing the accuracy of a method as a whole rather than at a
* ulps cited is for the worst-case error at any argument. If a * specific argument, the number of ulps cited is for the worst-case
* method always has an error less than 0.5 ulps, the method always * error at any argument. If a method always has an error less than
* returns the floating-point number nearest the exact result; such a * 0.5 ulps, the method always returns the floating-point number
* method is <i>correctly rounded</i>. A correctly rounded method is * nearest the exact result; such a method is <i>correctly
* generally the best a floating-point approximation can be; however, * rounded</i>. A correctly rounded method is generally the best a
* it is impractical for many floating-point methods to be correctly * floating-point approximation can be; however, it is impractical for
* rounded. Instead, for the {@code Math} class, a larger error * many floating-point methods to be correctly rounded. Instead, for
* bound of 1 or 2 ulps is allowed for certain methods. Informally, * the {@code Math} class, a larger error bound of 1 or 2 ulps is
* with a 1 ulp error bound, when the exact result is a representable * allowed for certain methods. Informally, with a 1 ulp error bound,
* number, the exact result should be returned as the computed result; * when the exact result is a representable number, the exact result
* otherwise, either of the two floating-point values which bracket * should be returned as the computed result; otherwise, either of the
* the exact result may be returned. For exact results large in * two floating-point values which bracket the exact result may be
* magnitude, one of the endpoints of the bracket may be infinite. * returned. For exact results large in magnitude, one of the
* Besides accuracy at individual arguments, maintaining proper * endpoints of the bracket may be infinite. Besides accuracy at
* relations between the method at different arguments is also * individual arguments, maintaining proper relations between the
* important. Therefore, most methods with more than 0.5 ulp errors * method at different arguments is also important. Therefore, most
* are required to be <i>semi-monotonic</i>: whenever the mathematical * methods with more than 0.5 ulp errors are required to be
* function is non-decreasing, so is the floating-point approximation, * <i>semi-monotonic</i>: whenever the mathematical function is
* likewise, whenever the mathematical function is non-increasing, so * non-decreasing, so is the floating-point approximation, likewise,
* is the floating-point approximation. Not all approximations that * whenever the mathematical function is non-increasing, so is the
* have 1 ulp accuracy will automatically meet the monotonicity * floating-point approximation. Not all approximations that have 1
* requirements. * ulp accuracy will automatically meet the monotonicity requirements.
* *
* @author unascribed * @author unascribed
* @author Joseph D. Darcy * @author Joseph D. Darcy
...@@ -940,11 +940,11 @@ public final class Math { ...@@ -940,11 +940,11 @@ public final class Math {
} }
/** /**
* Returns the size of an ulp of the argument. An ulp of a * Returns the size of an ulp of the argument. An ulp, unit in
* {@code double} value is the positive distance between this * the last place, of a {@code double} value is the positive
* floating-point value and the {@code double} value next * distance between this floating-point value and the {@code
* larger in magnitude. Note that for non-NaN <i>x</i>, * double} value next larger in magnitude. Note that for non-NaN
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>. * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* *
* <p>Special Cases: * <p>Special Cases:
* <ul> * <ul>
...@@ -967,11 +967,11 @@ public final class Math { ...@@ -967,11 +967,11 @@ public final class Math {
} }
/** /**
* Returns the size of an ulp of the argument. An ulp of a * Returns the size of an ulp of the argument. An ulp, unit in
* {@code float} value is the positive distance between this * the last place, of a {@code float} value is the positive
* floating-point value and the {@code float} value next * distance between this floating-point value and the {@code
* larger in magnitude. Note that for non-NaN <i>x</i>, * float} value next larger in magnitude. Note that for non-NaN
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>. * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* *
* <p>Special Cases: * <p>Special Cases:
* <ul> * <ul>
......
...@@ -932,11 +932,11 @@ public final class StrictMath { ...@@ -932,11 +932,11 @@ public final class StrictMath {
} }
/** /**
* Returns the size of an ulp of the argument. An ulp of a * Returns the size of an ulp of the argument. An ulp, unit in
* {@code double} value is the positive distance between this * the last place, of a {@code double} value is the positive
* floating-point value and the {@code double} value next * distance between this floating-point value and the {@code
* larger in magnitude. Note that for non-NaN <i>x</i>, * double} value next larger in magnitude. Note that for non-NaN
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>. * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* *
* <p>Special Cases: * <p>Special Cases:
* <ul> * <ul>
...@@ -959,11 +959,11 @@ public final class StrictMath { ...@@ -959,11 +959,11 @@ public final class StrictMath {
} }
/** /**
* Returns the size of an ulp of the argument. An ulp of a * Returns the size of an ulp of the argument. An ulp, unit in
* {@code float} value is the positive distance between this * the last place, of a {@code float} value is the positive
* floating-point value and the {@code float} value next * distance between this floating-point value and the {@code
* larger in magnitude. Note that for non-NaN <i>x</i>, * float} value next larger in magnitude. Note that for non-NaN
* <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>. * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
* *
* <p>Special Cases: * <p>Special Cases:
* <ul> * <ul>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册