@@ -42,32 +42,46 @@ function bcround(string $num, int $precision = 0, int $mode = PHP_ROUND_HALF_UP)
42
42
}
43
43
44
44
namespace BCMath {
45
- class Number {
45
+ class Number extends \Stringable {
46
+ public string $ value ;
47
+ public int $ scale ;
48
+
46
49
public function __construct (string |int $ num ) {}
47
50
48
51
/** @tentative-return-type */
49
- public function add (Number |string |int $ num , ?int $ scale = null ): Number {}
52
+ public function add (Number |string |int $ num , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
53
+
54
+ /** @tentative-return-type */
55
+ public function sub (Number |string |int $ num , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
56
+
57
+ /** @tentative-return-type */
58
+ public function mul (Number |string |int $ num , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
50
59
51
60
/** @tentative-return-type */
52
- public function sub (Number |string |int $ num , ?int $ scale = null ): Number {}
61
+ public function div (Number |string |int $ num , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
53
62
54
63
/** @tentative-return-type */
55
- public function mul (Number |string |int $ num , ?int $ scale = null ): Number {}
64
+ public function mod (Number |string |int $ num , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
56
65
57
66
/** @tentative-return-type */
58
- public function div (Number |string |int $ num , ?int $ scale = null ): Number {}
67
+ public function powmod (Number |string |int $ exponent , Number | string | int $ modulus , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
59
68
60
69
/** @tentative-return-type */
61
- public function mod (Number |string |int $ num , ?int $ scale = null ): Number {}
70
+ public function pow (Number |string |int $ exponent , int $ minScale , ?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
62
71
63
72
/** @tentative-return-type */
64
- public function powmod ( Number | string | int $ exponent , Number | string | int $ modulus , ? int $ scale = null ): Number {}
73
+ public function sqrt (? int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP ): Number {}
65
74
66
75
/** @tentative-return-type */
67
- public function pow (Number |string |int $ exponent , int $ minScale , ?int $ scale = null ): Number {}
76
+ public function floor (): Number {}
77
+
78
+ /** @tentative-return-type */
79
+ public function ceil (): Number {}
68
80
69
81
/** @tentative-return-type */
70
- public function sqrt (?int $ scale = null ): Number {}
82
+ public function round (int $ precision = 0 , int $ mode = PHP_ROUND_HALF_UP ): Number {}
83
+
84
+ public function comp (Number |string |int $ num , ?int $ scale = null ): int {}
71
85
72
86
/** @tentative-return-type */
73
87
public function eq (Number |string |int $ num , ?int $ scale = null ): bool {}
@@ -84,13 +98,8 @@ public function lt(Number|string|int $num, ?int $scale = null): bool {}
84
98
/** @tentative-return-type */
85
99
public function lte (Number |string |int $ num , ?int $ scale = null ): bool {}
86
100
87
- /** @tentative-return-type */
88
- public function floor (): Number {}
101
+ public function format (?int $ scale = null , int $ roundingMode = PHP_ROUND_HALF_UP , string $ decimalSeparator = '. ' , string $ thousandsSeparator = '' ): string {}
89
102
90
- /** @tentative-return-type */
91
- public function ceil (): Number {}
92
-
93
- /** @tentative-return-type */
94
- public function round (int $ precision = 0 , int $ mode = PHP_ROUND_HALF_UP ): Number {}
103
+ public function __toString (): string {}
95
104
}
96
105
}
0 commit comments