commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb AT ASF <s...@apache.org>
Subject Re: svn commit: r1328501 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java
Date Fri, 20 Apr 2012 21:21:49 GMT
On 20 April 2012 22:08,  <sebb@apache.org> wrote:
> Author: sebb
> Date: Fri Apr 20 21:08:41 2012
> New Revision: 1328501
>
> URL: http://svn.apache.org/viewvc?rev=1328501&view=rev
> Log:
> Document why we are not using the simpler Hex constants

Although the reasoning was included in the commit message, anyone
reading the code would not see it, and might wonder why we did not use
the constants.

[Commit log messages are effectively ephemeral; they are really only
of use in understanding the commit email message.]

> Modified:
>    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java
>
> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java
> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java?rev=1328501&r1=1328500&r2=1328501&view=diff
> ==============================================================================
> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java
(original)
> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/util/Precision.java
Fri Apr 20 21:08:41 2012
> @@ -40,12 +40,17 @@ public class Precision {
>      * In IEEE 754 arithmetic, this is 2<sup>-53</sup>: {@value}.
>      */
>     public static final double EPSILON = Double.longBitsToDouble((EXPONENT_OFFSET -
53l) << 52);
> +    //This was previously expressed as = 0x1.0p-53;
> +    // However, OpenJDK (Sparc Solaris) cannot handle such small constants: MATH-721
> +
>     /**
>      * Safe minimum, such that {@code 1 / SAFE_MIN} does not overflow.
>      * In IEEE 754 arithmetic, this is also the smallest normalized
>      * number 2<sup>-1022</sup>: {@value}.
>      */
>     public static final double SAFE_MIN = Double.longBitsToDouble((EXPONENT_OFFSET
- 1022l) << 52);
> +    // This was previously expressed as = 0x1.0p-1022;
> +    // However, OpenJDK (Sparc Solaris) cannot handle such small constants: MATH-721
>
>     /** Offset to order signed double numbers lexicographically. */
>     private static final long SGN_MASK = 0x8000000000000000L;
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message