xref: /PHP-8.0/ext/bcmath/tests/scale.phpt (revision a555cc0b)
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--EXPECT--
19bcadd:    3.00000
20bcdiv:    2.00000
21bcmul:    2.00000
22bcpow:    2.00000
23bcpowmod: 2.00000
24bcsqrt:   2.00000
25bcsub:    1.00000
26