Checkstyle.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1332162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastien Brisard 2012-04-30 11:26:10 +00:00
parent 0b8e0a285c
commit d0a5eff570
3 changed files with 22 additions and 11 deletions

View File

@ -26,7 +26,6 @@ import org.apache.commons.math3.exception.NotStrictlyPositiveException;
import org.apache.commons.math3.optimization.GoalType;
import org.apache.commons.math3.optimization.PointValuePair;
import org.apache.commons.math3.optimization.ConvergenceChecker;
import org.apache.commons.math3.optimization.AbstractConvergenceChecker;
import org.apache.commons.math3.optimization.MultivariateOptimizer;
import org.apache.commons.math3.optimization.univariate.BracketFinder;
import org.apache.commons.math3.optimization.univariate.BrentOptimizer;

View File

@ -150,6 +150,7 @@ public class MathArrays {
/**
* Check that an array is monotonically increasing or decreasing.
*
* @param <T> the type of the elements in the specified array
* @param val Values.
* @param dir Ordering direction.
* @param strict Whether the order should be strict.

View File

@ -30,19 +30,13 @@ import org.apache.commons.math3.util.FastMath;
* @version $Id$
*/
public class Precision {
/** Exponent offset in IEEE754 representation. */
private static final long EXPONENT_OFFSET = 1023l;
/**
* Smallest positive number such that {@code 1 - EPSILON} is not
* numerically equal to 1.
* <br/>
* In IEEE 754 arithmetic, this is 2<sup>-53</sup>.
*/
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
public static final double EPSILON;
/**
* Safe minimum, such that {@code 1 / SAFE_MIN} does not overflow.
@ -50,15 +44,32 @@ public class Precision {
* In IEEE 754 arithmetic, this is also the smallest normalized
* number 2<sup>-1022</sup>.
*/
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
public static final double SAFE_MIN;
/** Exponent offset in IEEE754 representation. */
private static final long EXPONENT_OFFSET = 1023l;
/** Offset to order signed double numbers lexicographically. */
private static final long SGN_MASK = 0x8000000000000000L;
/** Offset to order signed double numbers lexicographically. */
private static final int SGN_MASK_FLOAT = 0x80000000;
static {
/*
* This was previously expressed as = 0x1.0p-53;
* However, OpenJDK (Sparc Solaris) cannot handle such small
* constants: MATH-721
*/
EPSILON = Double.longBitsToDouble((EXPONENT_OFFSET - 53l) << 52);
/*
* This was previously expressed as = 0x1.0p-1022;
* However, OpenJDK (Sparc Solaris) cannot handle such small
* constants: MATH-721
*/
SAFE_MIN = Double.longBitsToDouble((EXPONENT_OFFSET - 1022l) << 52);
}
/**
* Private constructor.
*/