ucar.nc2.util
Class Misc

java.lang.Object
  extended by ucar.nc2.util.Misc

public class Misc
extends java.lang.Object

Miscellaneous static routines.

Author:
caron

Constructor Summary
Misc()
           
 
Method Summary
static boolean closeEnough(double v1, double v2)
          Check if numbers are equal with default tolerance
static boolean closeEnough(double v1, double v2, double tol)
          Check if numbers are equal with tolerance
static boolean closeEnough(float v1, float v2)
          Check if numbers are equal with default tolerance
static void main(java.lang.String[] args)
          test
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Misc

public Misc()
Method Detail

closeEnough

public static boolean closeEnough(double v1,
                                  double v2,
                                  double tol)
Check if numbers are equal with tolerance

Parameters:
v1 - first floating point number
v2 - second floating point number
tol - reletive tolerence
Returns:
true if within tolerance

closeEnough

public static boolean closeEnough(double v1,
                                  double v2)
Check if numbers are equal with default tolerance

Parameters:
v1 - first floating point number
v2 - second floating point number
Returns:
true if within tolerance

closeEnough

public static boolean closeEnough(float v1,
                                  float v2)
Check if numbers are equal with default tolerance

Parameters:
v1 - first floating point number
v2 - second floating point number
Returns:
true if within tolerance

main

public static void main(java.lang.String[] args)
test