org.geotools.geometry.iso.util
Class DoubleOperation

java.lang.Object
  extended by org.geotools.geometry.iso.util.DoubleOperation

public class DoubleOperation
extends java.lang.Object

This class offers elementary arithmetic operations for the elementary data type double. The operations are separated from the rest of the code to keep the option to interchange this package with a exact computation package (where needed). The implementations in this class are non-robust in sense that round-errors may occur.

Author:
Sanjay Jena

Constructor Summary
DoubleOperation()
           
 
Method Summary
static double add(double d1, double d2)
          Returns the sum of two doubles: d1 + d2
static double div(double d1, double d2)
          Returns the division of two doubles: d1 / d2
static double mult(double d1, double d2)
          Returns the multiplication of two doubles: d1 * d2
static double subtract(double d1, double d2)
          Returns the subtraction of two doubles: d1 - d2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleOperation

public DoubleOperation()
Method Detail

add

public static double add(double d1,
                         double d2)
Returns the sum of two doubles: d1 + d2

Parameters:
d1 - First value to add
d2 - Second value to add
Returns:
Sum of the two values

subtract

public static double subtract(double d1,
                              double d2)
Returns the subtraction of two doubles: d1 - d2

Parameters:
d1 - First value
d2 - Value to subtract from first value
Returns:
Subtraction d1 - d2

mult

public static double mult(double d1,
                          double d2)
Returns the multiplication of two doubles: d1 * d2

Parameters:
d1 - First value to multiplicate
d2 - Second value to multiplicate
Returns:
Product of the two values

div

public static double div(double d1,
                         double d2)
Returns the division of two doubles: d1 / d2

Parameters:
d1 - Dividend
d2 - Divisor
Returns:
Division of the two values


Copyright © 1996-2010 Geotools. All Rights Reserved.