Re: [RFC][Discussion] Raising zero to the power of negative number
| From: | Gina P. Banyard | Date: | Fri, 12 Jan 2024 00:52:18 +0000 |
| Subject: | Re: [RFC][Discussion] Raising zero to the power of negative number | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122146@lists.php.net to get a copy of this message | ||
On Thursday, 11 January 2024 at 21:47, tag Knife <fenniclog@gmail.com> wrote:
> On Thu, 11 Jan 2024 at 21:29, Jorg Sowa jorg.sowa@gmail.com 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
>
>
> IEEE 754 dictates that an infinity should be the expected output for all
> these scenarios.
IEEE 754 only deals with floating point numbers, and even then if you want IEEE 754 behaviour for
division you need to use fdiv() as of PHP 8.0 as any division by 0 throws this error since https://wiki.php.net/rfc/engine_warnings#division_by_zero
got accepted.
I think this change makes sense but would rather have an improved wording/Error as proposed by Ben.
Best regards,
Gina P. Banyard