Skip to content
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

POWER Needs to Accept NULL Args #4031

Merged
merged 3 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com)
and this project adheres to [Semantic Versioning](https://semver.org).

## TBD - 2.2.0

### Added

- Nothing

### Changed

- Nothing

### Deprecated

- Nothing

### Moved

- Nothing

### Fixed

- Incorrect Reader CSV with BOM. [Issue #4028](https://github.com/PHPOffice/PhpSpreadsheet/issues/4028) [PR #4029](https://github.com/PHPOffice/PhpSpreadsheet/pull/4029)
- POWER Null/Bool Args. [PR #4031](https://github.com/PHPOffice/PhpSpreadsheet/pull/4031)

## 2024-05-11 - 2.1.0

### MINOR BREAKING CHANGE
Expand Down
6 changes: 3 additions & 3 deletions src/PhpSpreadsheet/Calculation/MathTrig/Operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public static function mod(mixed $dividend, mixed $divisor): array|string|float
*
* Computes x raised to the power y.
*
* @param array|float|int|string $x Or can be an array of values
* @param array|float|int|string $y Or can be an array of values
* @param null|array|bool|float|int|string $x Or can be an array of values
* @param null|array|bool|float|int|string $y Or can be an array of values
*
* @return array|float|int|string The result, or a string containing an error
* If an array of numbers is passed as an argument, then the returned result will also be an array
* with the same dimensions
*/
public static function power(array|float|int|string $x, array|float|int|string $y): array|float|int|string
public static function power(null|array|bool|float|int|string $x, null|array|bool|float|int|string $y): array|float|int|string
{
if (is_array($x) || is_array($y)) {
return self::evaluateArrayArguments([self::class, __FUNCTION__], $x, $y);
Expand Down
5 changes: 5 additions & 0 deletions tests/data/Calculation/MathTrig/POWER.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,9 @@
],
['#VALUE!', 'x', 2],
['#VALUE!', 2, 'x'],
'exponent is null' => [1, 2, null],
'base is null' => [0, null, 2],
'both null' => ['#NUM!', null, null],
'exponent is bool' => [2, 2, true],
'base is bool' => [0, false, 2],
];
Loading