summaryrefslogtreecommitdiff
path: root/calc_test.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-11-03 00:17:06 +0800
committerxuri <xuri.me@gmail.com>2021-11-03 00:17:06 +0800
commit08ad10f68e0c603bac1499a0d7b93b251123a54b (patch)
tree81d65bc393c2db6a6d6af86720973e7265d6334f /calc_test.go
parentb0eb9ef807afb46b1b4f7932b4e08da1780e4fc1 (diff)
ref #65: new formula functions ERF, ERF.PRECISE, ERFC and ERFC.PRECISE
Diffstat (limited to 'calc_test.go')
-rw-r--r--calc_test.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/calc_test.go b/calc_test.go
index 88c58a6..b2fd5f4 100644
--- a/calc_test.go
+++ b/calc_test.go
@@ -143,6 +143,21 @@ func TestCalcCellValue(t *testing.T) {
"=DELTA(1.23,1.23)": "1",
"=DELTA(1)": "0",
"=DELTA(0)": "1",
+ // ERF
+ "=ERF(1.5)": "0.966105146475311",
+ "=ERF(0,1.5)": "0.966105146475311",
+ "=ERF(1,2)": "0.152621472069238",
+ // ERF.PRECISE
+ "=ERF.PRECISE(-1)": "-0.842700792949715",
+ "=ERF.PRECISE(1.5)": "0.966105146475311",
+ // ERFC
+ "=ERFC(0)": "1",
+ "=ERFC(0.5)": "0.479500122186953",
+ "=ERFC(-1)": "1.84270079294971",
+ // ERFC.PRECISE
+ "=ERFC.PRECISE(0)": "1",
+ "=ERFC.PRECISE(0.5)": "0.479500122186953",
+ "=ERFC.PRECISE(-1)": "1.84270079294971",
// GESTEP
"=GESTEP(1.2,0.001)": "1",
"=GESTEP(0.05,0.05)": "1",
@@ -1578,6 +1593,20 @@ func TestCalcCellValue(t *testing.T) {
"=DELTA(0,0,0)": "DELTA allows at most 2 arguments",
"=DELTA(\"\",0)": "strconv.ParseFloat: parsing \"\": invalid syntax",
"=DELTA(0,\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax",
+ // ERF
+ "=ERF()": "ERF requires at least 1 argument",
+ "=ERF(0,0,0)": "ERF allows at most 2 arguments",
+ "=ERF(\"\",0)": "strconv.ParseFloat: parsing \"\": invalid syntax",
+ "=ERF(0,\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax",
+ // ERF.PRECISE
+ "=ERF.PRECISE()": "ERF.PRECISE requires 1 argument",
+ "=ERF.PRECISE(\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax",
+ // ERFC
+ "=ERFC()": "ERFC requires 1 argument",
+ "=ERFC(\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax",
+ // ERFC.PRECISE
+ "=ERFC.PRECISE()": "ERFC.PRECISE requires 1 argument",
+ "=ERFC.PRECISE(\"\")": "strconv.ParseFloat: parsing \"\": invalid syntax",
// GESTEP
"=GESTEP()": "GESTEP requires at least 1 argument",
"=GESTEP(0,0,0)": "GESTEP allows at most 2 arguments",