Re: [PHP-DEV] Proposal: change precision for output functions

2019-01-07 Thread Semen Dubina
> 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/ --

Re: [PHP-DEV] Proposal: change precision for output functions

2019-01-07 Thread Semen Dubina
> 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 !==

Re: [PHP-DEV] Proposal: change precision for output functions

2019-01-07 Thread Semen Dubina
> 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

[PHP-DEV] Proposal: change precision for output functions

2019-01-07 Thread Semen Dubina
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