com.ebasetech.ufs.utility
Class MathUtil

java.lang.Object
  extended bycom.ebasetech.ufs.utility.MathUtil

public class MathUtil
extends java.lang.Object

Created by IntelliJ IDEA. User: benho Date: 02-Jun-2005 Time: 14:50:29 To change this template use File | Settings | File Templates.


Field Summary
private static java.math.BigInteger TEN
          all this stolen from BigInteger in Java 1.5
 
Constructor Summary
MathUtil()
           
 
Method Summary
static double between(double value, double min, double max)
          make value to that it is between or equal to min and max
static int between(int value, int min, int max)
          Adjust value so that it is between min and max.
private static int checkScale(java.math.BigInteger intVal, int signum, long val)
           
static java.math.BigDecimal makeBigDecimal(java.lang.Number obj)
          make a big decimal out a number
static java.math.BigInteger makeBigInteger(java.lang.Number obj)
          make a big integer out a number
static java.math.BigDecimal stripTrailingFractionZeros(java.math.BigDecimal bg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEN

private static final java.math.BigInteger TEN
all this stolen from BigInteger in Java 1.5

Constructor Detail

MathUtil

public MathUtil()
Method Detail

between

public static int between(int value,
                          int min,
                          int max)
Adjust value so that it is between min and max. (or equal)


between

public static double between(double value,
                             double min,
                             double max)
make value to that it is between or equal to min and max


makeBigInteger

public static java.math.BigInteger makeBigInteger(java.lang.Number obj)
make a big integer out a number

Parameters:
obj -
Returns:

makeBigDecimal

public static java.math.BigDecimal makeBigDecimal(java.lang.Number obj)
make a big decimal out a number

Parameters:
obj -
Returns:

stripTrailingFractionZeros

public static java.math.BigDecimal stripTrailingFractionZeros(java.math.BigDecimal bg)

checkScale

private static int checkScale(java.math.BigInteger intVal,
                              int signum,
                              long val)