Re: number_format() = "-0.00"
| From: | Craig Duncan | Date: | Fri, 25 Nov 2016 08:21:33 +0000 |
| Subject: | Re: number_format() = "-0.00" | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97173@lists.php.net to get a copy of this message | ||
On 25 Nov 2016 08:11, "Rasmus Lerdorf" <rasmus@lerdorf.com> wrote:
>
> This doesn't seem like a bug to me. Our floating point is all IEEE 754
and as per IEEE 754 -0.00 is the correct and expected result here.
I've just read the link below and I'm inclined to agree on the technical
reasoning.
https://en.wikipedia.org/wiki/Signed_zero
I'm not sure of its practical usage in PHP, I think most of our developers
would expect "0.00", but bring consistent with IEEE 754 makes sense.
Shall I add a note to the docs about this expected behaviour instead?