scale.phpt 673 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. BCMath functions return result with requested scale
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
  6. ?>
  7. --FILE--
  8. <?php
  9. echo
  10. 'bcadd: ', bcadd('2', '1', 5), PHP_EOL,
  11. 'bcdiv: ', bcdiv('2', '1', 5), PHP_EOL,
  12. 'bcmul: ', bcmul('2', '1', 5), PHP_EOL,
  13. 'bcpow: ', bcpow('2', '1', 5), PHP_EOL,
  14. 'bcpowmod: ', bcpowmod('2', '1', '3', 5), PHP_EOL,
  15. 'bcsqrt: ', bcsqrt('4', 5), PHP_EOL,
  16. 'bcsub: ', bcsub('2', '1', 5), PHP_EOL;
  17. ?>
  18. ===DONE===
  19. --EXPECT--
  20. bcadd: 3.00000
  21. bcdiv: 2.00000
  22. bcmul: 2.00000
  23. bcpow: 2.00000
  24. bcpowmod: 2.00000
  25. bcsqrt: 2.00000
  26. bcsub: 1.00000
  27. ===DONE===