On 1/11/24 15:29, Jorg Sowa wrote:
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,
Jorg


In Python, the error message for `0 ** -1` is:

    ZeroDivisionError: 0.0 cannot be raised to a negative power

Instead 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 power

I 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: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to