org.apache.myfaces.tobago.internal.layout
Class MathUtils

java.lang.Object
  extended by org.apache.myfaces.tobago.internal.layout.MathUtils

public class MathUtils
extends Object


Field Summary
static double EPSILON
          Values smaller than this EPSILON should be treated as zero.
 
Constructor Summary
MathUtils()
           
 
Method Summary
static void adjustRemainders(double[] list, double bias)
          Adjusts the list of double values to rounded values with the same sum.
static double findAndAdjustMaxRemainder(double[] list)
           
static double findAndAdjustMinRemainder(double[] list)
           
static boolean isInteger(double value)
           
static boolean isNotInteger(double value)
           
static boolean isNotZero(double factor)
           
static boolean isZero(double factor)
           
static double remainder(double v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPSILON

public static final double EPSILON
Values smaller than this EPSILON should be treated as zero.

See Also:
Constant Field Values
Constructor Detail

MathUtils

public MathUtils()
Method Detail

adjustRemainders

public static void adjustRemainders(double[] list,
                                    double bias)
Adjusts the list of double values to rounded values with the same sum. E. g. 2.3, 2.4, 2.5, 2.8 -> 2.0, 2.0, 3.0, 3.0

Parameters:
list -

findAndAdjustMaxRemainder

public static double findAndAdjustMaxRemainder(double[] list)

findAndAdjustMinRemainder

public static double findAndAdjustMinRemainder(double[] list)

remainder

public static double remainder(double v)

isZero

public static boolean isZero(double factor)

isNotZero

public static boolean isNotZero(double factor)

isInteger

public static boolean isInteger(double value)

isNotInteger

public static boolean isNotInteger(double value)


Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.