$grand_total = (float)$subtotal_email + (float)$delivery_email + (float)$fuel_surcharge_email - (float)$discount_coupon_email + (float)$texas_tax_email - (float)$cancel_fee_email - (float)$refund_email - (float)$refund_tax_email - (float)$coupon_tmp;
echo (float)$subtotal_email." + ".(float)$delivery_email." + ".(float)$fuel_surcharge_email." - ".(float)$discount_coupon_email." + ".(float)$texas_tax_email." - ".(float)$cancel_fee_email." - ".(float)$refund_email." - ".(float)$refund_tax_email." - ".(float)$coupon_tmp." = ".(float)$grand_total;
上記をphpで実行すると、次の出力が得られます。
89.99 + 0 + 16.2 - 0 + 8.61 - 3 - 100 - 10 - 1.8 = -2.88657986403E-15
しかし、LHSを見ると、そうあるべきです0
。これは、フロートの有無にかかわらず発生します。