Skip to content

Commit 7478f20

Browse files
authored
Decrease floating precision
Relative error for PHP floats is about 10^-16 (http://php.net/manual/en/language.types.float.php). Precision setting to 17 has the following affect: ``` ini_set('precision', 17); $obj['val'] = 6.40; $out = json_encode($obj); echo $out; // {"val":6.4000000000000004} ```
1 parent af11309 commit 7478f20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@
6363
date_default_timezone_set('UTC');
6464

6565
/* Adjustment of precision value for several versions of PHP */
66-
ini_set('precision', 17);
67-
ini_set('serialize_precision', 17);
66+
ini_set('precision', 15);
67+
ini_set('serialize_precision', 15);

0 commit comments

Comments
 (0)