Bug #79861 [Opn->Nab]: bug found in php 5.3, 5.4. 7.0, 7.1, 7.2

From: Date: Tue, 14 Jul 2020 19:39:07 +0000
Subject: Bug #79861 [Opn->Nab]: bug found in php 5.3, 5.4. 7.0, 7.1, 7.2
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228044@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79861&edit=1 ID: 79861 Updated by: requinix@php.net Reported by: BardoQi at gmail dot com Summary: bug found in php 5.3, 5.4. 7.0, 7.1, 7.2 -Status: Open +Status: Not a bug Type: Bug Package: Unknown/Other Function Operating System: windwos 10, contos7 PHP Version: 7.2.32 Block user comment: N Private report: N New Comment: Floating point values have a limited precision. Hence a value might not have the same string representation after any processing. That also includes writing a floating point value in your script and directly printing it without any mathematical operations. If you would like to know more about "floats" and what IEEE 754 is, read this: http://www.floating-point-gui.de/ Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2020-07-14 19:35:25] BardoQi at gmail dot com Description: ------------ The return value of expression /(4.1-0.1 == 4.0)/ should be true, but infact false!! Test script: --------------- echo(4.1-0.1 == 4.0); echo(4.1-0.1 == 4); echo((4.1-0.1) == 4.0); echo((4.1-0.1) == 4); Expected result: ---------------- 1111 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79861&edit=1

« previous php.bugs (#228044) next »