PhpSpreadsheet/tests/PhpSpreadsheetTests/Calculation/Functions/Engineering
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
..
BesselITest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
BesselJTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
BesselKTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
BesselYTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Bin2DecTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Bin2HexTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Bin2OctTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
BitAndTest.php Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
BitLShiftTest.php Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
BitOrTest.php Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
BitRShiftTest.php Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
BitXorTest.php Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
ComplexTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ConvertUoMTest.php Additional Unit Test Cases for Convert UoM (#1864) 2021-02-19 08:41:26 +01:00
Dec2BinTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Dec2HexTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Dec2OctTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
DeltaTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ErfCTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ErfPreciseTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ErfTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
GeStepTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Hex2BinTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Hex2DecTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Hex2OctTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
ImAbsTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImArgumentTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImConjugateTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImCosTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImCoshTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImCotTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImCscTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImCschTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImDivTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImExpTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImLnTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImLog2Test.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImLog10Test.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImPowerTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImProductTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImRealTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSecTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSechTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSinTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSinhTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSqrtTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSubTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImSumTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImTanTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
ImaginaryTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
MovedBitwiseTest.php Bitwise Functions and 32-bit (#1900) 2021-03-14 20:05:31 +01:00
MovedFunctionsTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Oct2BinTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Oct2DecTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
Oct2HexTest.php Improve Coverage of BIN2DEC etc. (#1902) 2021-03-14 20:04:50 +01:00
ParseComplexTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00