From 361611c23ae56cac091d5c7d73f5ea305b5bd3fc Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 11 Mar 2022 00:07:30 +0800 Subject: ref #65, new formula functions: GAMMA.DIST and GAMMADIST --- calc_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'calc_test.go') diff --git a/calc_test.go b/calc_test.go index 9804cc9..0c9fb2e 100644 --- a/calc_test.go +++ b/calc_test.go @@ -835,6 +835,12 @@ func TestCalcCellValue(t *testing.T) { "=GAMMA(INT(1))": "1", "=GAMMA(1.5)": "0.886226925452758", "=GAMMA(5.5)": "52.34277778455352", + // GAMMA.DIST + "=GAMMA.DIST(6,3,2,FALSE)": "0.112020903827694", + "=GAMMA.DIST(6,3,2,TRUE)": "0.576809918873156", + // GAMMADIST + "=GAMMADIST(6,3,2,FALSE)": "0.112020903827694", + "=GAMMADIST(6,3,2,TRUE)": "0.576809918873156", // GAMMALN "=GAMMALN(4.5)": "2.45373657084244", "=GAMMALN(INT(1))": "0", @@ -2382,6 +2388,24 @@ func TestCalcCellValue(t *testing.T) { "=GAMMA(F1)": "GAMMA requires 1 numeric argument", "=GAMMA(0)": "#N/A", "=GAMMA(INT(0))": "#N/A", + // GAMMA.DIST + "=GAMMA.DIST()": "GAMMA.DIST requires 4 arguments", + "=GAMMA.DIST(\"\",3,2,FALSE)": "strconv.ParseFloat: parsing \"\": invalid syntax", + "=GAMMA.DIST(6,\"\",2,FALSE)": "strconv.ParseFloat: parsing \"\": invalid syntax", + "=GAMMA.DIST(6,3,\"\",FALSE)": "strconv.ParseFloat: parsing \"\": invalid syntax", + "=GAMMA.DIST(6,3,2,\"\")": "strconv.ParseBool: parsing \"\": invalid syntax", + "=GAMMA.DIST(-1,3,2,FALSE)": "#NUM!", + "=GAMMA.DIST(6,0,2,FALSE)": "#NUM!", + "=GAMMA.DIST(6,3,0,FALSE)": "#NUM!", + // GAMMADIST + "=GAMMADIST()": "GAMMADIST requires 4 arguments", + "=GAMMADIST(\"\",3,2,FALSE)": "strconv.ParseFloat: parsing \"\": invalid syntax", + "=GAMMADIST(6,\"\",2,FALSE)": "strconv.ParseFloat: parsing \"\": invalid syntax", + "=GAMMADIST(6,3,\"\",FALSE)": "strconv.ParseFloat: parsing \"\": invalid syntax", + "=GAMMADIST(6,3,2,\"\")": "strconv.ParseBool: parsing \"\": invalid syntax", + "=GAMMADIST(-1,3,2,FALSE)": "#NUM!", + "=GAMMADIST(6,0,2,FALSE)": "#NUM!", + "=GAMMADIST(6,3,0,FALSE)": "#NUM!", // GAMMALN "=GAMMALN()": "GAMMALN requires 1 numeric argument", "=GAMMALN(F1)": "GAMMALN requires 1 numeric argument", -- cgit v1.2.1