mirror of
https://github.com/apache/commons-math.git
synced 2025-02-06 10:09:26 +00:00
Another unit test.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1067018 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
719fc75901
commit
95080b966f
@ -78,4 +78,18 @@ public class StepFunctionTest {
|
||||
Assert.assertEquals(51.2, f.value(30), EPS);
|
||||
Assert.assertEquals(51.2, f.value(Double.POSITIVE_INFINITY), EPS);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHeaviside() {
|
||||
final UnivariateRealFunction h = new StepFunction(new double[] {-1, 0},
|
||||
new double[] {0, 1});
|
||||
|
||||
Assert.assertEquals(0, h.value(Double.NEGATIVE_INFINITY), 0);
|
||||
Assert.assertEquals(0, h.value(-Double.MAX_VALUE), 0);
|
||||
Assert.assertEquals(0, h.value(-2), 0);
|
||||
Assert.assertEquals(0, h.value(-Double.MIN_VALUE), 0);
|
||||
Assert.assertEquals(1, h.value(0), 0);
|
||||
Assert.assertEquals(1, h.value(2), 0);
|
||||
Assert.assertEquals(1, h.value(Double.POSITIVE_INFINITY), 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user