fork download
  1. <?php
  2.  
  3. $price = 24.5;
  4. $discountPrice = 7.35;
  5. $discount = $price - $discountPrice;
  6.  
  7. "DISC: %.53f\nPRIC: %.53f\nACTU: %.53f\n N_F: %.53f\nROUN: %f\n\n",
  8. $discount,
  9. $price,
  10. (100 * $discount / $price),
  11. number_format((100 * $discount / $price), 13),
  12. (100 * $discount / $price)
  13. );
  14.  
  15. "DISC: %.53f\nPRIC: %.53f\nACTU: %.53f\n N_F: %.53f\nROUN: %f\n\n",
  16. $discount,
  17. $price,
  18. (100 * $discount / $price),
  19. number_format((100 * $discount / $price), 14),
  20. (100 * $discount / $price)
  21. );
  22.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
DISC: 17.14999999999999857891452847979962825775146484375000000
PRIC: 24.50000000000000000000000000000000000000000000000000000
ACTU: 69.99999999999998578914528479799628257751464843750000000
 N_F: 70.00000000000000000000000000000000000000000000000000000
ROUN: 70.000000

DISC: 17.14999999999999857891452847979962825775146484375000000
PRIC: 24.50000000000000000000000000000000000000000000000000000
ACTU: 69.99999999999998578914528479799628257751464843750000000
 N_F: 69.99999999999998578914528479799628257751464843750000000
ROUN: 70.000000