From f4e9bfe99faf9cd8a1d3cf9d1cc86df706b347bd Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Mon, 25 Feb 2013 15:19:41 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1449744 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/math3/dfp/DfpTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/org/apache/commons/math3/dfp/DfpTest.java b/src/test/java/org/apache/commons/math3/dfp/DfpTest.java index 4750d4d96..39512cd86 100644 --- a/src/test/java/org/apache/commons/math3/dfp/DfpTest.java +++ b/src/test/java/org/apache/commons/math3/dfp/DfpTest.java @@ -1634,4 +1634,14 @@ public class DfpTest extends AbstractExtendedFieldElementTest { } + @Test + public void testSpecialConstructors() { + Assert.assertEquals(ninf, field.newDfp(Double.NEGATIVE_INFINITY)); + Assert.assertEquals(ninf, field.newDfp("-Infinity")); + Assert.assertEquals(pinf, field.newDfp(Double.POSITIVE_INFINITY)); + Assert.assertEquals(pinf, field.newDfp("Infinity")); + Assert.assertTrue(field.newDfp(Double.NaN).isNaN()); + Assert.assertTrue(field.newDfp("NaN").isNaN()); + } + }