> 08.01.2019, 00:39, "Legale.legale" :
> What proposal? I'm talking about elementary arithmetic.
>
> Take a look here:
> Https://jdoodle.com/embed/v0/Tgu
Yes, floating-point arithmetic says: '0.8!=0.1+0.7'.
jdoodle.com/a/Thv
Will we discuss this now?
-- Semen V. Dubina https://sam002.net/
--
AFAIK, gettext functions do depend on setlocale.
I wish so much that it wasn't the case (as you then need to have the
locale installed on the system), but it is, so setlocale definetely is
quite used in the wild and deprecating it seems a bit far-fetched
unless we can actually replace it with
What proposal? I'm talking about elementary arithmetic.
Take a look here:
Https://jdoodle.com/embed/v0/Tgu
On Jan 7, 2019 10:32 PM, Semen Dubina wrote:
>
>
> > 07.01.2019, 22:17, "Legale.legale" :
> > I think your solution by changing precision is not good enough because
> > float summation
> 07.01.2019, 22:17, "Legale.legale" :
> I think your solution by changing precision is not good enough because float
> summation is still not working properly.
>
> var_dump(0.1 + 0.7);
>
> returns:
>
> 0.79
>
> expected: 0.8
>
Hi!
If you are about the proposal, then '0.1 + 0.7 !==
I think your solution by changing precision is not good enough because float
summation is still not working properly.
wrote:
>
> > 07.01.2019, 20:24, "Thomas Bley" :
> >
> > Hello,
> >
> > good point, having:
> >
> > echo ini_get('precision') . PHP_EOL;
> > echo
> 07.01.2019, 20:24, "Thomas Bley" :
>
> Hello,
>
> good point, having:
>
> echo ini_get('precision') . PHP_EOL;
> echo ini_get('serialize_precision') . PHP_EOL;
> echo json_encode(array('price' => round('45.99', 2))) . PHP_EOL;
> echo (0.1+0.7), json_encode(0.1+0.7) . PHP_EOL;
>
> gives
Semen Dubina wrote on 07.01.2019 16:38:
> Hi, everyone!
> Original PR and description see: https://github.com/php/php-src/pull/3460.
>
> Because of the accuracy constraint set by the 'precision' variable, debugging
> problems often occur, and many developers consider the limited accuracy to be
Hi, everyone!
Original PR and description see: https://github.com/php/php-src/pull/3460.
Because of the accuracy constraint set by the 'precision' variable, debugging
problems often occur, and many developers consider the limited accuracy to be a
feature of the language.
For better