MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.util
Class LongDouble

java.lang.Object
  extended by ch.ethz.mxquery.util.LongDouble

public class LongDouble
extends java.lang.Object

Double implementation on an integer.
NaN, Inf, and Exponential representation (e.g. 2e-4) are not supported


Field Summary
static int maxDecimalPlaces
           
 
Constructor Summary
LongDouble(int decimalPlaces)
          Constructor
LongDouble(long init, int decimalPlaces)
          Constructor
LongDouble(java.lang.String str, int decimalPlaces)
          Constructor
 
Method Summary
 LongDouble add(int i)
           
 LongDouble add(LongDouble ld)
           
 int compareTo(int i)
           
 int compareTo(LongDouble ld)
           
 LongDouble divide(int i)
           
 LongDouble divide(LongDouble ld)
           
 boolean equals(LongDouble ld)
           
 boolean equals(java.lang.Object o)
           
 boolean equalsZero()
           
 int getIntValue()
           
static int getLastDigit(long value)
          Returns the last digit of the passed value.
 int hashCode()
           
 int idiv(int i)
           
 int idiv(LongDouble ld)
           
 LongDouble mod(int i)
           
 LongDouble mod(LongDouble ld)
           
 LongDouble multiply(int i)
           
 LongDouble multiply(LongDouble ld)
           
 LongDouble negate()
           
 LongDouble subtract(int i)
           
 LongDouble subtract(LongDouble ld)
           
 java.lang.String toString()
           
 boolean unequals(LongDouble ld)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

maxDecimalPlaces

public static final int maxDecimalPlaces
See Also:
Constant Field Values
Constructor Detail

LongDouble

public LongDouble(int decimalPlaces)
Constructor

Parameters:
decimalPlaces -

LongDouble

public LongDouble(java.lang.String str,
                  int decimalPlaces)
Constructor

Parameters:
str - tries to parse this string
decimalPlaces -

LongDouble

public LongDouble(long init,
                  int decimalPlaces)
Constructor

Parameters:
init - initial value (only integer)
decimalPlaces -
Method Detail

getLastDigit

public static int getLastDigit(long value)
Returns the last digit of the passed value.

Parameters:
value -
Returns:
the last digit

equalsZero

public boolean equalsZero()

add

public LongDouble add(LongDouble ld)

add

public LongDouble add(int i)

subtract

public LongDouble subtract(LongDouble ld)

subtract

public LongDouble subtract(int i)

multiply

public LongDouble multiply(LongDouble ld)

multiply

public LongDouble multiply(int i)

divide

public LongDouble divide(LongDouble ld)
                  throws MXQueryException
Throws:
MXQueryException

divide

public LongDouble divide(int i)

mod

public LongDouble mod(LongDouble ld)

mod

public LongDouble mod(int i)

idiv

public int idiv(LongDouble ld)
         throws MXQueryException
Throws:
MXQueryException

idiv

public int idiv(int i)

negate

public LongDouble negate()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(LongDouble ld)

unequals

public boolean unequals(LongDouble ld)

compareTo

public int compareTo(LongDouble ld)

compareTo

public int compareTo(int i)

getIntValue

public int getIntValue()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich