edu.harvard.econcs.util
Class FloatingUtil
java.lang.Object
edu.harvard.econcs.util.FloatingUtil
public class FloatingUtil
- extends java.lang.Object
Mipinator.MaxValue is 29 bits. Java double representation is 52 bits for the mantissa.
This leaves 23 bits for the floating point part, at worst. So at worst, this means
that values this huge have a (2^-23)/2 = 0.000000059604644775390625 representation error.
With an epsilon of .001f, this means that we can have ~16,000 operations with max error and
still be ok. This seems like a lot and probably fine for the exchange.
- Since:
- Dec 2, 2004
- Version:
- $Revision: 1.1 $ on $Date: 2005/05/16 23:27:28 $
Method Summary |
static boolean |
equal(double a,
double b)
|
static boolean |
greater(double a,
double b)
|
static boolean |
greaterEqual(double a,
double b)
|
static boolean |
less(double a,
double b)
|
static boolean |
lessEqual(double a,
double b)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FloatingUtil
public FloatingUtil()
equal
public static boolean equal(double a,
double b)
greater
public static boolean greater(double a,
double b)
less
public static boolean less(double a,
double b)
greaterEqual
public static boolean greaterEqual(double a,
double b)
lessEqual
public static boolean lessEqual(double a,
double b)