php 浮点数对比 14 April,2023——Mesong
function func($otderTotalGrand, $historyRefundAmount,$recharge_amount ) { $canRefundAmount = $otderTotalGrand - $historyRefundAmount; $canRefundBool = bccomp($canRefundAmount, $recharge_amount, 2); if ($otderTotalGrand < $historyRefundAmount || $canRefundBool === -1) { throw new Exception('error message'); } return true; }
评论