Bug #77512 [Opn->Nab]: Mathematical errors

From: Date: Thu, 24 Jan 2019 11:19:17 +0000
Subject: Bug #77512 [Opn->Nab]: Mathematical errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219164@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77512&edit=1 ID: 77512 Updated by: cmb@php.net Reported by: lea21st at qq dot com Summary: Mathematical errors -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Cenots7.4 PHP Version: 7.1.26 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php From the PHP manual[1]: | Operands of modulo are converted to integers (by stripping the | decimal part) before processing. For floating-point modulo, see | fmod(). [1] <php.net/manual/en/language.operators.arithmetic.php> Previous Comments: ------------------------------------------------------------------------ [2019-01-24 10:35:09] lea21st at qq dot com Description: ------------ 2.333%1==0; //true 2%1==0; //true 2.333%1,It should be false,2.333%1 is 0.33300000 Test script: --------------- var_dump(2%1); var_dump(2.333%1); Expected result: ---------------- 0 0.333000000000 Actual result: -------------- 0 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77512&edit=1

« previous php.bugs (#219164) next »