xref: /php-src/ext/bcmath/bcmath.stub.php (revision f6db576c)
1<?php
2
3/** @generate-class-entries */
4
5namespace
6{
7    /** @refcount 1 */
8    function bcadd(string $num1, string $num2, ?int $scale = null): string {}
9
10    /** @refcount 1 */
11    function bcsub(string $num1, string $num2, ?int $scale = null): string {}
12
13    /** @refcount 1 */
14    function bcmul(string $num1, string $num2, ?int $scale = null): string {}
15
16    /** @refcount 1 */
17    function bcdiv(string $num1, string $num2, ?int $scale = null): string {}
18
19    /** @refcount 1 */
20    function bcmod(string $num1, string $num2, ?int $scale = null): string {}
21
22    /**
23     * @return string[]
24     * @refcount 1
25     */
26    function bcdivmod(string $num1, string $num2, ?int $scale = null): array {}
27
28    /** @refcount 1 */
29    function bcpowmod(string $num, string $exponent, string $modulus, ?int $scale = null): string {}
30
31    /** @refcount 1 */
32    function bcpow(string $num, string $exponent, ?int $scale = null): string {}
33
34    /** @refcount 1 */
35    function bcsqrt(string $num, ?int $scale = null): string {}
36
37    function bccomp(string $num1, string $num2, ?int $scale = null): int {}
38
39    function bcscale(?int $scale = null): int {}
40
41    /** @refcount 1 */
42    function bcfloor(string $num): string {}
43
44    /** @refcount 1 */
45    function bcceil(string $num): string {}
46
47    /** @refcount 1 */
48    function bcround(string $num, int $precision = 0, RoundingMode $mode = RoundingMode::HalfAwayFromZero): string {}
49}
50
51namespace BcMath
52{
53    /** @strict-properties */
54    final readonly class Number implements \Stringable
55    {
56        /** @virtual */
57        public string $value;
58        /** @virtual */
59        public int $scale;
60
61        public function __construct(string|int $num) {}
62
63        public function add(Number|string|int $num, ?int $scale = null): Number {}
64
65        public function sub(Number|string|int $num, ?int $scale = null): Number {}
66
67        public function mul(Number|string|int $num, ?int $scale = null): Number {}
68
69        public function div(Number|string|int $num, ?int $scale = null): Number {}
70
71        public function mod(Number|string|int $num, ?int $scale = null): Number {}
72
73        /** @return Number[] */
74        public function divmod(Number|string|int $num, ?int $scale = null): array {}
75
76        public function powmod(Number|string|int $exponent, Number|string|int $modulus, ?int $scale = null): Number {}
77
78        public function pow(Number|string|int $exponent, ?int $scale = null): Number {}
79
80        public function sqrt(?int $scale = null): Number {}
81
82        public function floor(): Number {}
83
84        public function ceil(): Number {}
85
86        public function round(int $precision = 0, \RoundingMode $mode = \RoundingMode::HalfAwayFromZero): Number {}
87
88        public function compare(Number|string|int $num, ?int $scale = null): int {}
89
90        public function __toString(): string {}
91
92        public function __serialize(): array {}
93
94        public function __unserialize(array $data): void {}
95    }
96}
97