Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
bae8264c
Commit
bae8264c
authored
Jul 24, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add BITOR formula
parent
93a38219
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
19 deletions
+55
-19
cell/.unit-tests/FormulaTests.js
cell/.unit-tests/FormulaTests.js
+8
-0
cell/model/FormulaObjects/_xlfnFunctions.js
cell/model/FormulaObjects/_xlfnFunctions.js
+2
-14
cell/model/FormulaObjects/engineeringFunctions.js
cell/model/FormulaObjects/engineeringFunctions.js
+45
-5
No files found.
cell/.unit-tests/FormulaTests.js
View file @
bae8264c
...
...
@@ -7680,6 +7680,14 @@ $( function () {
});
test
(
"
Test:
\"
BITOR
\"
"
,
function
()
{
oParser
=
new
parserFormula
(
'
BITOR(23,10)
'
,
"
AA2
"
,
ws
);
ok
(
oParser
.
parse
());
strictEqual
(
oParser
.
calculate
().
getValue
(),
31
);
});
function
putDataForDatabase
(){
ws
.
getRange2
(
"
A1
"
).
setValue
(
"
Tree
"
);
ws
.
getRange2
(
"
A2
"
).
setValue
(
"
Apple
"
);
...
...
cell/model/FormulaObjects/_xlfnFunctions.js
View file @
bae8264c
...
...
@@ -51,7 +51,7 @@
cFormulaFunctionGroup
[
'
DateAndTime
'
]
=
cFormulaFunctionGroup
[
'
DateAndTime
'
]
||
[];
cFormulaFunctionGroup
[
'
DateAndTime
'
].
push
(
cDAYS
,
cISOWEEKNUM
);
cFormulaFunctionGroup
[
'
Engineering
'
]
=
cFormulaFunctionGroup
[
'
Engineering
'
]
||
[];
cFormulaFunctionGroup
[
'
Engineering
'
].
push
(
cBITLSHIFT
,
cBIT
OR
,
cBIT
RSHIFT
,
cBITXOR
);
cFormulaFunctionGroup
[
'
Engineering
'
].
push
(
cBITLSHIFT
,
cBITRSHIFT
,
cBITXOR
);
cFormulaFunctionGroup
[
'
TextAndData
'
]
=
cFormulaFunctionGroup
[
'
TextAndData
'
]
||
[];
cFormulaFunctionGroup
[
'
TextAndData
'
].
push
(
cDBCS
,
cUNICHAR
,
cUNICODE
);
cFormulaFunctionGroup
[
'
Statistical
'
]
=
cFormulaFunctionGroup
[
'
Statistical
'
]
||
[];
...
...
@@ -67,7 +67,7 @@
cFormulaFunctionGroup
[
'
Information
'
].
push
(
cSHEET
,
cSHEETS
);
cFormulaFunctionGroup
[
'
NotRealised
'
]
=
cFormulaFunctionGroup
[
'
NotRealised
'
]
||
[];
cFormulaFunctionGroup
[
'
NotRealised
'
].
push
(
cDAYS
,
cISOWEEKNUM
,
cBITLSHIFT
,
cBIT
OR
,
cBIT
RSHIFT
,
cBITXOR
,
cFormulaFunctionGroup
[
'
NotRealised
'
].
push
(
cDAYS
,
cISOWEEKNUM
,
cBITLSHIFT
,
cBITRSHIFT
,
cBITXOR
,
cDBCS
,
cUNICHAR
,
cUNICODE
,
cBINOM_DIST_RANGE
,
cF_TEST
,
cFORECAST_ETS
,
cFORECAST_ETS_CONFINT
,
cFORECAST_ETS_SEASONALITY
,
cFORECAST_ETS_STAT
,
cHYPGEOM_DIST
,
cPDURATION
,
cAGGREGATE
,
cMUNIT
,
cFORMULATEXT
,
cSHEET
,
cSHEETS
);
...
...
@@ -108,18 +108,6 @@
cBITLSHIFT
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cBITLSHIFT
.
prototype
.
constructor
=
cBITLSHIFT
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cBITOR
()
{
cBaseFunction
.
call
(
this
,
"
BITOR
"
);
this
.
isXLFN
=
true
;
}
cBITOR
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cBITOR
.
prototype
.
constructor
=
cBITOR
;
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
...
...
cell/model/FormulaObjects/engineeringFunctions.js
View file @
bae8264c
...
...
@@ -935,11 +935,11 @@
};
cFormulaFunctionGroup
[
'
Engineering
'
]
=
cFormulaFunctionGroup
[
'
Engineering
'
]
||
[];
cFormulaFunctionGroup
[
'
Engineering
'
].
push
(
cBESSELI
,
cBESSELJ
,
cBESSELK
,
cBESSELY
,
cBIN2DEC
,
cBIN2HEX
,
cBIN2OCT
,
cBITAND
,
c
COMPLEX
,
cCONVERT
,
cDEC2BIN
,
cDEC2HEX
,
cDEC2OCT
,
cDELTA
,
cERF
,
cERF_PRECISE
,
cERFC
,
cERFC_PRECISE
,
cGESTEP
,
cHEX2BIN
,
c
HEX2DEC
,
cHEX2OCT
,
cIMABS
,
cIMAGINARY
,
cIMARGUMENT
,
cIMCONJUGATE
,
cIMCOS
,
cIMCOSH
,
cIMCOT
,
cIMCSC
,
cIMCSCH
,
cIM
DIV
,
cIMEXP
,
cIMLN
,
cIMLOG10
,
cIMLOG2
,
cIMPOWER
,
cIMPRODUCT
,
cIMREAL
,
cIMSEC
,
cIMSECH
,
cIMSIN
,
cIMSINH
,
cIMSQRT
,
cIMSUB
,
cIMSUM
,
cIMTAN
,
cOCT2BIN
,
cOCT2DEC
,
cOCT2HEX
);
cFormulaFunctionGroup
[
'
Engineering
'
].
push
(
cBESSELI
,
cBESSELJ
,
cBESSELK
,
cBESSELY
,
cBIN2DEC
,
cBIN2HEX
,
cBIN2OCT
,
c
BITAND
,
cBITOR
,
cCOMPLEX
,
cCONVERT
,
cDEC2BIN
,
cDEC2HEX
,
cDEC2OCT
,
cDELTA
,
cERF
,
cERF_PRECISE
,
cERFC
,
c
ERFC_PRECISE
,
cGESTEP
,
cHEX2BIN
,
cHEX2DEC
,
cHEX2OCT
,
cIMABS
,
cIMAGINARY
,
cIMARGUMENT
,
cIMCONJUGATE
,
cIMCOS
,
cIM
COSH
,
cIMCOT
,
cIMCSC
,
cIMCSCH
,
cIMDIV
,
cIMEXP
,
cIMLN
,
cIMLOG10
,
cIMLOG2
,
cIMPOWER
,
cIMPRODUCT
,
cIMREAL
,
cIMS
EC
,
cIMSECH
,
cIMSIN
,
cIMSINH
,
cIMS
QRT
,
cIMSUB
,
cIMSUM
,
cIMTAN
,
cOCT2BIN
,
cOCT2DEC
,
cOCT2HEX
);
cFormulaFunctionGroup
[
'
NotRealised
'
]
=
cFormulaFunctionGroup
[
'
NotRealised
'
]
||
[];
cFormulaFunctionGroup
[
'
NotRealised
'
].
push
(
cBESSELI
,
cBESSELJ
,
cBESSELK
,
cBESSELY
,
cCONVERT
);
...
...
@@ -1250,6 +1250,46 @@
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
calcFunc
);
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function
cBITOR
()
{
cBaseFunction
.
call
(
this
,
"
BITOR
"
);
}
cBITOR
.
prototype
=
Object
.
create
(
cBaseFunction
.
prototype
);
cBITOR
.
prototype
.
constructor
=
cBITOR
;
cBITOR
.
prototype
.
argumentsMin
=
2
;
cBITOR
.
prototype
.
argumentsMax
=
2
;
cBITOR
.
prototype
.
isXLFN
=
true
;
cBITOR
.
prototype
.
Calculate
=
function
(
arg
)
{
var
oArguments
=
this
.
_prepareArguments
(
arg
,
arguments
[
1
],
true
);
var
argClone
=
oArguments
.
args
;
argClone
[
0
]
=
argClone
[
0
].
tocNumber
();
argClone
[
1
]
=
argClone
[
1
].
tocNumber
();
var
argError
;
if
(
argError
=
this
.
_checkErrorArg
(
argClone
))
{
return
this
.
value
=
argError
;
}
var
calcFunc
=
function
(
argArray
){
var
arg0
=
Math
.
floor
(
argArray
[
0
]);
var
arg1
=
Math
.
floor
(
argArray
[
1
]);
if
(
arg0
<
0
||
arg1
<
0
/*|| arg0 > 2^48 || arg1 > 2^48*/
){
return
new
cError
(
cErrorType
.
not_numeric
);
}
var
res
=
arg0
|
arg1
;
return
null
!==
res
&&
!
isNaN
(
res
)
?
new
cNumber
(
res
)
:
new
cError
(
cErrorType
.
wrong_value_type
);
};
return
this
.
value
=
this
.
_findArrayInNumberArguments
(
oArguments
,
calcFunc
);
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment