xref: /PHP-7.4/ext/bcmath/tests/scale.phpt (revision 870ed510)
1--TEST--
2BCMath functions return result with requested scale
3--SKIPIF--
4<?php
5if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
6?>
7--FILE--
8<?php
9echo
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--
20bcadd:    3.00000
21bcdiv:    2.00000
22bcmul:    2.00000
23bcpow:    2.00000
24bcpowmod: 2.00000
25bcsqrt:   2.00000
26bcsub:    1.00000
27===DONE===
28