PhpSpreadsheet/tests/data/Calculation
oleibman 30c880b5e6
Bitwise Functions and 32-bit (#1900)
* Bitwise Functions and 32-bit

When running the test suite with 32-bit PHP, a failure was reported in BITLSHIFT.
In fact, all of the following are vulnerable to problems, and didn't report
any failures only because of a scarcity of tests:
- BITAND
- BITOR
- BITXOR
- BITRSHIFT
- BITLSHIFT

Those last 2 can be resolved fairly easily by using multiplication by a power of 2
rather than shifting. The first 3 are a tougher nut to crack, and I will continue
to think how they might best be approached. For now, I have added skippable tests
for each of them, which at least documents the problem.

Aside from adding many new tests, some bugs were correctd:
- The function list in Calculation.php pointed BITXOR to BITOR.
- All 5 functions allow null/false/true parameters.
- BIT*SHIFT shift amount must be numeric, can be negative, allows decimal portion
(which is truncated to integer), and has an absolute value limit of 53.
- Because BITRSHIFT allows negative shift amount, its result can overflow
(in which case return NAN).
- All 5 functions disallow negative parameters (except ...SHIFT second parameter).
This was coded, but the code had been thwarted by an earlier is_int test.

* Full Support for AND/OR/XOR on 32-bit

Previous version did not support operands 2**32 through 2**48.
2021-03-14 20:05:31 +01:00
..
DateTime 100% Coverage for Calculation/DateTime (#1870) 2021-02-27 20:43:22 +01:00
DefinedNames Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
Engineering Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
Financial Update PPMT & IPMT implementation to better reflect excel behaviour. Update CUMPRINC & CUMIPMT implementation to prevent a crash while trying to add a string to a number. Update AMORLINC & AMORDEGRC to prevent crash when trying to multiply a string by a number. Update related unit tests. Update changelog to describe what we fixed. (#1840) 2021-02-12 18:04:52 +01:00
Functions Fixed Functions->ifCondition for allowing <> and empty condition 2019-11-17 21:03:11 +01:00
Logical Add support for IFS() logical function (#1442) 2020-06-20 18:21:19 +02:00
LookupRef First step extracting INDIRECT() and OFFSET() to their own classes (#1921) 2021-03-14 19:58:10 +01:00
MathTrig Continue MathTrig Breakup - Trig Functions (#1905) 2021-03-13 12:06:30 +01:00
Statistical Trend unit tests (#1899) 2021-03-06 22:50:19 +01:00
TextData Additional argument validation for LEFT(), MID() and RIGHT() text functions (#1909) 2021-03-08 12:54:06 +01:00
Web WEBSERVICE is HTTP client agnostic 2020-07-19 11:33:01 +09:00
Calculation.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
FunctionsAsString.php MATCH with a static array should return the position of the found value based on the values submitted. 2020-04-26 22:09:31 +09:00
Translations.php Initial Formula Translation tests (#1886) 2021-02-28 13:18:51 +01:00