Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util
Class DoubleEqualityComparator

java.lang.Object
  extended by com.jivesoftware.util.DoubleEqualityComparator

public final class DoubleEqualityComparator
extends java.lang.Object

This class determines the parameters of the floating point representation and provides methods for comparing the equality of floating point numbers. "This material from The Java(tm) Specialists' Newsletter by Maximum Solutions (South Africa). Please contact Maximum Solutions for more information." (http://www.javaspecialists.co.za/archive/Issue044.html)


Method Summary
static double defaultNumericalPrecision()
           
static boolean equals(double a, double b)
           
static boolean equals(double a, double b, double precision)
           
static double getMachinePrecision()
           
static int getRadix()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRadix

public static int getRadix()

getMachinePrecision

public static double getMachinePrecision()

defaultNumericalPrecision

public static double defaultNumericalPrecision()

equals

public static boolean equals(double a,
                             double b)
Returns:
true if the difference between a and b is less than the default numerical precision

equals

public static boolean equals(double a,
                             double b,
                             double precision)
Returns:
true if the relative difference between a and b is less than precision

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.