Skip to content

Commit f5c1e87

Browse files
authored
Merge pull request #4031 from oleibman/powernullarg
POWER Needs to Accept NULL Args
2 parents 1314f82 + 989a44d commit f5c1e87

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com)
66
and this project adheres to [Semantic Versioning](https://semver.org).
77

8+
## TBD - 2.2.0
9+
10+
### Added
11+
12+
- Nothing
13+
14+
### Changed
15+
16+
- Nothing
17+
18+
### Deprecated
19+
20+
- Nothing
21+
22+
### Moved
23+
24+
- Nothing
25+
26+
### Fixed
27+
28+
- Incorrect Reader CSV with BOM. [Issue #4028](https://github.com/PHPOffice/PhpSpreadsheet/issues/4028) [PR #4029](https://github.com/PHPOffice/PhpSpreadsheet/pull/4029)
29+
- POWER Null/Bool Args. [PR #4031](https://github.com/PHPOffice/PhpSpreadsheet/pull/4031)
30+
831
## 2024-05-11 - 2.1.0
932

1033
### MINOR BREAKING CHANGE

src/PhpSpreadsheet/Calculation/MathTrig/Operations.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ public static function mod(mixed $dividend, mixed $divisor): array|string|float
5252
*
5353
* Computes x raised to the power y.
5454
*
55-
* @param array|float|int|string $x Or can be an array of values
56-
* @param array|float|int|string $y Or can be an array of values
55+
* @param null|array|bool|float|int|string $x Or can be an array of values
56+
* @param null|array|bool|float|int|string $y Or can be an array of values
5757
*
5858
* @return array|float|int|string The result, or a string containing an error
5959
* If an array of numbers is passed as an argument, then the returned result will also be an array
6060
* with the same dimensions
6161
*/
62-
public static function power(array|float|int|string $x, array|float|int|string $y): array|float|int|string
62+
public static function power(null|array|bool|float|int|string $x, null|array|bool|float|int|string $y): array|float|int|string
6363
{
6464
if (is_array($x) || is_array($y)) {
6565
return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y);

tests/data/Calculation/MathTrig/POWER.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,4 +410,9 @@
410410
],
411411
['#VALUE!', 'x', 2],
412412
['#VALUE!', 2, 'x'],
413+
'exponent is null' => [1, 2, null],
414+
'base is null' => [0, null, 2],
415+
'both null' => ['#NUM!', null, null],
416+
'exponent is bool' => [2, 2, true],
417+
'base is bool' => [0, false, 2],
413418
];

0 commit comments

Comments
 (0)