aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-02-03 10:24:06 +0000
committerPJ Fanning <fanningpj@apache.org>2022-02-03 10:24:06 +0000
commit98a93d1041556a84439a75d3737270ac680b9f16 (patch)
treec8d51945f99cd6d862afa068d53ae8f6a5e70cd9 /poi/src
parent9a97204dc8cd4613f43480359243221bdecfe15e (diff)
downloadpoi-98a93d1041556a84439a75d3737270ac680b9f16.tar.gz
poi-98a93d1041556a84439a75d3737270ac680b9f16.zip
add SIGN tests
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897716 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r--poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumericFunction.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumericFunction.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumericFunction.java
index 77d204aeff..2f08587adc 100644
--- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumericFunction.java
+++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNumericFunction.java
@@ -38,4 +38,16 @@ final class TestNumericFunction {
assertDouble(fe, cell, "880000000*0.00849/3", 2490400.0, 0);
assertDouble(fe, cell, "INT(880000000*0.00849/3)", 2490400.0, 0);
}
+
+ @Test
+ void testSIGN() {
+ HSSFWorkbook wb = new HSSFWorkbook();
+ HSSFCell cell = wb.createSheet().createRow(0).createCell(0);
+ HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
+ //https://support.microsoft.com/en-us/office/sign-function-109c932d-fcdc-4023-91f1-2dd0e916a1d8
+ assertDouble(fe, cell, "SIGN(10)", 1.0, 0);
+ assertDouble(fe, cell, "SIGN(4-4)", 0.0, 0);
+ assertDouble(fe, cell, "SIGN(-0.00001)", -1.0, 0);
+ }
+
}