Re: [RFC][Discussion] Raising zero to the power of negative number
| From: | Ben Ramsey | Date: | Thu, 11 Jan 2024 21:45:52 +0000 |
| Subject: | Re: [RFC][Discussion] Raising zero to the power of negative number | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122143@lists.php.net to get a copy of this message | ||
On 1/11/24 15:29, Jorg Sowa wrote:
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc
Hello everyone! I want to start the discussion on the RFC: Raising zero to the power of negative number Link: https://wiki.php.net/rfc/raising_zero_to_power_of_negative_number Kind regards, JorgIn Python, the error message for
0 ** -1 is:
ZeroDivisionError: 0.0 cannot be raised to a negative powerInstead of "DivisionByZeroError: Division by zero" as the PHP exception message, could we use a similar message? Something like:
DivisionByZeroError: Zero cannot be raised to a negative powerI think this will be clearer to a user who encounters this error and isn't aware that raising zero to a negative power is the equivalent of dividing by zero. Cheers, Ben
Attachment: [application/pgp-signature] OpenPGP digital signature OpenPGP_signature.asc