blob: c285d747a7f58c76f84fe44bc3c25d4f7fdfa461 (
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 and returns the remainder.
*
* @author $Author: $
* @version $Revision: $, $Date: $ UTC
*/
public class Modulo extends BinaryOperator
{
/**
* Intentionally empty.
*
*/
public Modulo()
{
}
/*
* (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;
}
}
|