|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-04-30 12:36 UTC] kacper dot rowinski at gmail dot com
[2018-04-30 13:54 UTC] cmb@php.net
-Status: Open
+Status: Analyzed
-Type: Bug
+Type: Documentation Problem
-Assigned To:
+Assigned To: cmb
[2018-04-30 13:54 UTC] cmb@php.net
[2018-04-30 17:20 UTC] kacper dot rowinski at gmail dot com
[2018-04-30 22:11 UTC] cmb@php.net
[2018-04-30 22:12 UTC] cmb@php.net
-Status: Analyzed
+Status: Closed
[2018-04-30 22:12 UTC] cmb@php.net
[2020-02-07 06:05 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 15:00:01 2025 UTC |
Description: ------------ Using bcmod on float return incorrect value Test script: --------------- <?php $leftOperand = '0.00000000099999'; $modulus = '-0.00056'; $scale =14; // incorrect : echo bcmod($leftOperand,$modulus, $scale); // this how it should work // mod(a, b) = a - b * floor(a/b) /* echo bcsub( $leftOperand, bcmul( $modulus, floor(bcdiv($leftOperand, $modulus, $scale)), $scale ), $scale ); */ Expected result: ---------------- -0.00055999900001 Actual result: -------------- 0.00000000099999