PhpSpreadsheet/tests/PhpSpreadsheetTests/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
..
Engine Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
Functions Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
CalculationTest.php Fix for Issue #1887 - Lose Track of Selected Cells After Save (#1908) 2021-03-10 21:23:08 +01:00
DefinedNameConfusedForCellTest.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
DefinedNamesCalculationTest.php Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
FormulaAsStringTest.php Named formula implementation, and improved handling of Defined Names generally (#1535) 2020-07-26 12:00:06 +02:00
FunctionsTest.php Restoring State After Static Changes in Tests (#1571) 2020-07-15 13:23:00 +02:00
LookupRefTest.php Unhappy path tests for FORMULATEXT() Function (#1915) 2021-03-10 22:38:41 +01:00
TranslationTest.php Initial Formula Translation tests (#1886) 2021-02-28 13:18:51 +01:00
XlfnFunctionsTest.php Save Excel 2010+ Functions Properly 2020-05-18 12:37:35 +09:00