summaryrefslogtreecommitdiffstats
path: root/src/de/fhswf/in/inf/upnfx/util/Division.java
blob: 1bcd9fbbe84efe210b92288ffc9c9d6c6851a5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
 * 
 */
package de.fhswf.in.inf.upnfx.util;

/**
 * Divides two double values.
 *
 * @author $Author: $
 * @version $Revision: $, $Date: $ UTC
 */
public class Division extends BinaryOperator
{

   /**
    * Intentionally empty.
    *
    */
   public Division()
   {
   }

   /*
    * (non-Javadoc)
    * 
    * @see de.fhswf.in.inf.java1.aufgabe12.BinaryOperator#eval(double, double)
    */
   @Override
   final double eval(double d1, double d2)
   {
      if (d2 == 0.0)
      {
         throw new IllegalArgumentException("Divisor can't be 0.");
      }

      return d1 / d2;
   }

}