@ -60,55 +60,88 @@ func TestCalcCellValue(t *testing.T) {
"=1&2" : "12" ,
"=1&2" : "12" ,
"=15%" : "0.15" ,
"=15%" : "0.15" ,
"=1+20%" : "1.2" ,
"=1+20%" : "1.2" ,
"={1}+2" : "3" ,
"=1+{2}" : "3" ,
"={1}+{2}" : "3" ,
` ="A"="A" ` : "TRUE" ,
` ="A"="A" ` : "TRUE" ,
` ="A"<>"A" ` : "FALSE" ,
` ="A"<>"A" ` : "FALSE" ,
// Engineering Functions
// Engineering Functions
// BESSELI
// BESSELI
"=BESSELI(4.5,1)" : "15.3892227537359" ,
"=BESSELI(4.5,1)" : "15.3892227537359" ,
"=BESSELI(32,1)" : "5502845511211.25" ,
"=BESSELI(32,1)" : "5502845511211.25" ,
"=BESSELI({32},1)" : "5502845511211.25" ,
"=BESSELI(32,{1})" : "5502845511211.25" ,
"=BESSELI({32},{1})" : "5502845511211.25" ,
// BESSELJ
// BESSELJ
"=BESSELJ(1.9,2)" : "0.329925727692387" ,
"=BESSELJ(1.9,2)" : "0.329925727692387" ,
"=BESSELJ({1.9},2)" : "0.329925727692387" ,
"=BESSELJ(1.9,{2})" : "0.329925727692387" ,
"=BESSELJ({1.9},{2})" : "0.329925727692387" ,
// BESSELK
// BESSELK
"=BESSELK(0.05,0)" : "3.11423403428966" ,
"=BESSELK(0.05,0)" : "3.11423403428966" ,
"=BESSELK(0.05,1)" : "19.9096743272486" ,
"=BESSELK(0.05,1)" : "19.9096743272486" ,
"=BESSELK(0.05,2)" : "799.501207124235" ,
"=BESSELK(0.05,2)" : "799.501207124235" ,
"=BESSELK(3,2)" : "0.0615104585619118" ,
"=BESSELK(3,2)" : "0.0615104585619118" ,
"=BESSELK({3},2)" : "0.0615104585619118" ,
"=BESSELK(3,{2})" : "0.0615104585619118" ,
"=BESSELK({3},{2})" : "0.0615104585619118" ,
// BESSELY
// BESSELY
"=BESSELY(0.05,0)" : "-1.97931100684153" ,
"=BESSELY(0.05,0)" : "-1.97931100684153" ,
"=BESSELY(0.05,1)" : "-12.789855163794" ,
"=BESSELY(0.05,1)" : "-12.789855163794" ,
"=BESSELY(0.05,2)" : "-509.61489554492" ,
"=BESSELY(0.05,2)" : "-509.61489554492" ,
"=BESSELY(9,2)" : "-0.229082087487741" ,
"=BESSELY(9,2)" : "-0.229082087487741" ,
"=BESSELY({9},2)" : "-0.229082087487741" ,
"=BESSELY(9,{2})" : "-0.229082087487741" ,
"=BESSELY({9},{2})" : "-0.229082087487741" ,
// BIN2DEC
// BIN2DEC
"=BIN2DEC(\"10\")" : "2" ,
"=BIN2DEC(\"10\")" : "2" ,
"=BIN2DEC(\"11\")" : "3" ,
"=BIN2DEC(\"11\")" : "3" ,
"=BIN2DEC(\"0000000010\")" : "2" ,
"=BIN2DEC(\"0000000010\")" : "2" ,
"=BIN2DEC(\"1111111110\")" : "-2" ,
"=BIN2DEC(\"1111111110\")" : "-2" ,
"=BIN2DEC(\"110\")" : "6" ,
"=BIN2DEC(\"110\")" : "6" ,
"=BIN2DEC({\"110\"})" : "6" ,
// BIN2HEX
// BIN2HEX
"=BIN2HEX(\"10\")" : "2" ,
"=BIN2HEX(\"10\")" : "2" ,
"=BIN2HEX(\"0000000001\")" : "1" ,
"=BIN2HEX(\"0000000001\")" : "1" ,
"=BIN2HEX(\"10\",10)" : "0000000002" ,
"=BIN2HEX(\"10\",10)" : "0000000002" ,
"=BIN2HEX(\"1111111110\")" : "FFFFFFFFFE" ,
"=BIN2HEX(\"1111111110\")" : "FFFFFFFFFE" ,
"=BIN2HEX(\"11101\")" : "1D" ,
"=BIN2HEX(\"11101\")" : "1D" ,
"=BIN2HEX({\"11101\"})" : "1D" ,
// BIN2OCT
// BIN2OCT
"=BIN2OCT(\"101\")" : "5" ,
"=BIN2OCT(\"101\")" : "5" ,
"=BIN2OCT(\"0000000001\")" : "1" ,
"=BIN2OCT(\"0000000001\")" : "1" ,
"=BIN2OCT(\"10\",10)" : "0000000002" ,
"=BIN2OCT(\"10\",10)" : "0000000002" ,
"=BIN2OCT(\"1111111110\")" : "7777777776" ,
"=BIN2OCT(\"1111111110\")" : "7777777776" ,
"=BIN2OCT(\"1110\")" : "16" ,
"=BIN2OCT(\"1110\")" : "16" ,
"=BIN2OCT({\"1110\"})" : "16" ,
// BITAND
// BITAND
"=BITAND(13,14)" : "12" ,
"=BITAND(13,14)" : "12" ,
"=BITAND({13},14)" : "12" ,
"=BITAND(13,{14})" : "12" ,
"=BITAND({13},{14})" : "12" ,
// BITLSHIFT
// BITLSHIFT
"=BITLSHIFT(5,2)" : "20" ,
"=BITLSHIFT(5,2)" : "20" ,
"=BITLSHIFT(3,5)" : "96" ,
"=BITLSHIFT({3},5)" : "96" ,
"=BITLSHIFT(3,5)" : "96" ,
"=BITLSHIFT(3,{5})" : "96" ,
"=BITLSHIFT({3},{5})" : "96" ,
// BITOR
// BITOR
"=BITOR(9,12)" : "13" ,
"=BITOR(9,12)" : "13" ,
"=BITOR({9},12)" : "13" ,
"=BITOR(9,{12})" : "13" ,
"=BITOR({9},{12})" : "13" ,
// BITRSHIFT
// BITRSHIFT
"=BITRSHIFT(20,2)" : "5" ,
"=BITRSHIFT(20,2)" : "5" ,
"=BITRSHIFT(52,4)" : "3" ,
"=BITRSHIFT(52,4)" : "3" ,
"=BITRSHIFT({52},4)" : "3" ,
"=BITRSHIFT(52,{4})" : "3" ,
"=BITRSHIFT({52},{4})" : "3" ,
// BITXOR
// BITXOR
"=BITXOR(5,6)" : "3" ,
"=BITXOR(5,6)" : "3" ,
"=BITXOR(9,12)" : "5" ,
"=BITXOR(9,12)" : "5" ,
"=BITXOR({9},12)" : "5" ,
"=BITXOR(9,{12})" : "5" ,
"=BITXOR({9},{12})" : "5" ,
// COMPLEX
// COMPLEX
"=COMPLEX(5,2)" : "5+2i" ,
"=COMPLEX(5,2)" : "5+2i" ,
"=COMPLEX(5,-9)" : "5-9i" ,
"=COMPLEX(5,-9)" : "5-9i" ,
@ -221,6 +254,7 @@ func TestCalcCellValue(t *testing.T) {
"=HEX2OCT(\"8\",10)" : "0000000010" ,
"=HEX2OCT(\"8\",10)" : "0000000010" ,
"=HEX2OCT(\"FFFFFFFFF8\")" : "7777777770" ,
"=HEX2OCT(\"FFFFFFFFF8\")" : "7777777770" ,
"=HEX2OCT(\"1F3\")" : "763" ,
"=HEX2OCT(\"1F3\")" : "763" ,
"=HEX2OCT({\"1F3\"})" : "763" ,
// IMABS
// IMABS
"=IMABS(\"2j\")" : "2" ,
"=IMABS(\"2j\")" : "2" ,
"=IMABS(\"-1+2i\")" : "2.23606797749979" ,
"=IMABS(\"-1+2i\")" : "2.23606797749979" ,
@ -773,6 +807,7 @@ func TestCalcCellValue(t *testing.T) {
"=1+SUM(SUM(1,2*3),4)*4/3+5+(4+2)*3" : "38.6666666666667" ,
"=1+SUM(SUM(1,2*3),4)*4/3+5+(4+2)*3" : "38.6666666666667" ,
"=SUM(1+ROW())" : "2" ,
"=SUM(1+ROW())" : "2" ,
"=SUM((SUM(2))+1)" : "3" ,
"=SUM((SUM(2))+1)" : "3" ,
"=SUM({1,2,3,4,\"\"})" : "10" ,
// SUMIF
// SUMIF
` =SUMIF(F1:F5, "") ` : "0" ,
` =SUMIF(F1:F5, "") ` : "0" ,
` =SUMIF(A1:A5, "3") ` : "3" ,
` =SUMIF(A1:A5, "3") ` : "3" ,