Skip to content

Add new Complex Number Functions introduced in MS Excel 2013 #601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
18c8373
- Refactored Complex Engineering Functions to use external complex nu…
Jul 15, 2018
8a3754f
CS fixes in tests
Jul 15, 2018
0584e30
CS tweaks
Jul 15, 2018
d933ce4
Fixed missing ; accidentally deleted when fixing cs sniffs
Jul 15, 2018
a1b7f84
Really am getting annoyed with phpcs complaints about English grammar
Jul 15, 2018
a495b6c
And cs issues with numbers of blank lines
Jul 15, 2018
0143a60
Feels like I'm trying to fix more trivial (and arguable) cs issues th…
Jul 15, 2018
f416099
Unit tests for the new Complex functions
Jul 15, 2018
22c82a9
Merge branch 'develop' into complex
Jul 15, 2018
09a5413
Ensure latest comlex library release is composer'd in
Jul 15, 2018
f50d1e9
Ensure latest comlex library release is composer'd in
Jul 15, 2018
4c3dda5
Merge branch 'develop' into complex
Jul 22, 2018
7a1db9f
Restored the parseComplex() method in the PhpOffice\PhpSpreadsheet\Ca…
Jul 22, 2018
636e4c7
Handling for incompatible suffixes
Jul 23, 2018
1f67f68
Trying to ensure that composer pulls the correct version of the compl…
Jul 23, 2018
06873f1
Travis is a real pita with composer
Jul 23, 2018
4e3f769
D*** composer lock file
Jul 23, 2018
1793fb6
Cleanup of scrutinizer issues
Jul 24, 2018
04462a7
Simplify unit tests using the Complex\Complex class rather than a cus…
Jul 24, 2018
450ad98
Fix assertions for power() tests
Jul 24, 2018
f16c723
Remove redundant $log argument
Jul 24, 2018
c43fb0a
Upgrade complex library version to 1.4.1
Jul 24, 2018
5359b57
Merge branch 'develop' into complex
Jul 25, 2018
9c4bcca
Unit test for the now deprecated parseComplex() function
Jul 25, 2018
bb0d22f
Documentation updates
Jul 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Support workbook view attributes for Xlsx format - [#523](https://github.com/PHPOffice/PhpSpreadsheet/issues/523)
- Read and write hyperlink for drawing image - [#490](https://github.com/PHPOffice/PhpSpreadsheet/pull/490)
- Added calculation engine support for the new bitwise functions that were added in MS Excel 2013
- BITAND() Returns a Bitwise 'And' of two numbers
- BITOR() Returns a Bitwise 'Or' of two number
- BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers
- BITLSHIFT() Returns a number shifted left by a specified number of bits
- BITRSHIFT() Returns a number shifted right by a specified number of bits
- BITAND() Returns a Bitwise 'And' of two numbers
- BITOR() Returns a Bitwise 'Or' of two number
- BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers
- BITLSHIFT() Returns a number shifted left by a specified number of bits
- BITRSHIFT() Returns a number shifted right by a specified number of bits
- Added calculation engine support for other new functions that were added in MS Excel 2013 and MS Excel 2016
- Text Functions
- CONCAT() Synonym for CONCATENATE()
Expand Down Expand Up @@ -46,6 +46,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- COTH() Returns the hyperbolic cotangent of an angle
- ACOT() Returns the cotangent of an angle
- ACOTH() Returns the hyperbolic cotangent of an angle
- Refactored Complex Engineering Functions to use external complex number library
- Added calculation engine support for the new complex number functions that were added in MS Excel 2013
- IMCOSH() Returns the hyperbolic cosine of a complex number
- IMCOT() Returns the cotangent of a complex number
- IMCSC() Returns the cosecant of a complex number
- IMCSCH() Returns the hyperbolic cosecant of a complex number
- IMSEC() Returns the secant of a complex number
- IMSECH() Returns the hyperbolic secant of a complex number
- IMSINH() Returns the hyperbolic sine of a complex number
- IMTAN() Returns the tangent of a complex number

### Fixed

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"psr/simple-cache": "^1.0"
"psr/simple-cache": "^1.0",
"markbaker/complex": "^1.4.1"
},
"require-dev": {
"tecnickcom/tcpdf": "^6.2",
Expand Down
97 changes: 96 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions docs/references/function-list-by-category.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ IMAGINARY | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMAGINA
IMARGUMENT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT
IMCONJUGATE | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE
IMCOS | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS
IMCOSH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOSH
IMCOT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOT
IMCSC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSC
IMCSCH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSCH
IMDIV | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV
IMEXP | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP
IMLN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN
Expand All @@ -94,10 +98,14 @@ IMLOG2 | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLOG2
IMPOWER | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER
IMPRODUCT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT
IMREAL | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL
IMSEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSEC
IMSECH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSECH
IMSIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN
IMSINH | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSINH
IMSQRT | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT
IMSUB | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB
IMSUM | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM
IMTAN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMTAN
OCT2BIN | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOBIN
OCT2DEC | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTODEC
OCT2HEX | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::OCTTOHEX
Expand Down
8 changes: 8 additions & 0 deletions docs/references/function-list-by-name.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ IMAGINARY | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet
IMARGUMENT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMARGUMENT
IMCONJUGATE | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCONJUGATE
IMCOS | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOS
IMCOSH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOSH
IMCOT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCOT
IMCSC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSC
IMCSCH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMCSCH
IMDIV | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMDIV
IMEXP | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMEXP
IMLN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMLN
Expand All @@ -214,10 +218,14 @@ IMLOG2 | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet
IMPOWER | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPOWER
IMPRODUCT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMPRODUCT
IMREAL | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMREAL
IMSEC | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSEC
IMSECH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSECH
IMSIN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSIN
IMSINH | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSINH
IMSQRT | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSQRT
IMSUB | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUB
IMSUM | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMSUM
IMTAN | CATEGORY_ENGINEERING | \PhpOffice\PhpSpreadsheet\Calculation\Engineering::IMTAN
INDEX | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDEX
INDIRECT | CATEGORY_LOOKUP_AND_REFERENCE | \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::INDIRECT
INFO | CATEGORY_INFORMATION | **Not yet Implemented**
Expand Down
40 changes: 40 additions & 0 deletions src/PhpSpreadsheet/Calculation/Calculation.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,26 @@ class Calculation
'functionCall' => [Engineering::class, 'IMCOS'],
'argumentCount' => '1',
],
'IMCOSH' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMCOSH'],
'argumentCount' => '1',
],
'IMCOT' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMCOT'],
'argumentCount' => '1',
],
'IMCSC' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMCSC'],
'argumentCount' => '1',
],
'IMCSCH' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMCSCH'],
'argumentCount' => '1',
],
'IMDIV' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMDIV'],
Expand Down Expand Up @@ -1078,11 +1098,26 @@ class Calculation
'functionCall' => [Engineering::class, 'IMREAL'],
'argumentCount' => '1',
],
'IMSEC' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMSEC'],
'argumentCount' => '1',
],
'IMSECH' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMSECH'],
'argumentCount' => '1',
],
'IMSIN' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMSIN'],
'argumentCount' => '1',
],
'IMSINH' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMSINH'],
'argumentCount' => '1',
],
'IMSQRT' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMSQRT'],
Expand All @@ -1098,6 +1133,11 @@ class Calculation
'functionCall' => [Engineering::class, 'IMSUM'],
'argumentCount' => '1+',
],
'IMTAN' => [
'category' => Category::CATEGORY_ENGINEERING,
'functionCall' => [Engineering::class, 'IMTAN'],
'argumentCount' => '1',
],
'INDEX' => [
'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
'functionCall' => [LookupRef::class, 'INDEX'],
Expand Down
Loading