1 | <?php |
||
8 | class Math extends Gmp |
||
9 | { |
||
10 | /** |
||
11 | * @param int|string $first |
||
12 | * @param int|string $second |
||
13 | * @return bool |
||
14 | */ |
||
15 | public function notEq($first, $second) |
||
16 | { |
||
17 | return $this->cmp($first, $second) !== 0; |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @param $first |
||
22 | * @param $second |
||
23 | * @return bool |
||
24 | */ |
||
25 | public function eq($first, $second) |
||
26 | { |
||
27 | return $this->cmp($first, $second) === 0; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param int|string $first |
||
32 | * @param int|string $second |
||
33 | * @return bool |
||
34 | */ |
||
35 | public function greaterThan($first, $second) |
||
39 | |||
40 | /** |
||
41 | * @param int|string $first |
||
42 | * @param int|string $second |
||
43 | * @return bool |
||
44 | */ |
||
45 | public function greatherThanEq($first, $second) |
||
49 | |||
50 | /** |
||
51 | * @param int|string $first |
||
52 | * @param int|string $second |
||
53 | * @return bool |
||
54 | */ |
||
55 | public function lessThan($first, $second) |
||
59 | |||
60 | /** |
||
61 | * @param int|string $first |
||
62 | * @param int|string $second |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function lessThanEq($first, $second) |
||
69 | |||
70 | /** |
||
71 | * @return BinaryMath |
||
72 | */ |
||
73 | 132 | public function getBinaryMath() |
|
77 | |||
78 | /** |
||
79 | * @param $integer |
||
80 | * @return bool |
||
81 | */ |
||
82 | 222 | public function isEven($integer) |
|
86 | |||
87 | /** |
||
88 | * @param int|string $int |
||
89 | * @param int|string $otherInt |
||
90 | * @return string |
||
91 | */ |
||
92 | 864 | public function bitwiseOr($int, $otherInt) |
|
96 | |||
97 | /** |
||
98 | * Similar to gmp_div_qr, return a tuple containing the |
||
99 | * result and the remainder |
||
100 | * |
||
101 | * @param $dividend |
||
102 | * @param integer $divisor |
||
103 | * @return array |
||
104 | */ |
||
105 | 222 | public function divQr($dividend, $divisor) |
|
113 | |||
114 | /** |
||
115 | * @param int|string $compact |
||
116 | * @param bool|false $isNegative |
||
117 | * @param bool|false $isOverflow |
||
118 | * @return int|string |
||
119 | */ |
||
120 | 1260 | public function writeCompact($compact, &$isNegative, &$isOverflow) |
|
142 | |||
143 | /** |
||
144 | * @param int|string $integer |
||
145 | * @return int|string |
||
146 | */ |
||
147 | 108 | public function getLow64($integer) |
|
152 | |||
153 | /** |
||
154 | * @param int|string $integer |
||
155 | * @param bool $fNegative |
||
156 | * @return int|string |
||
157 | */ |
||
158 | 114 | public function parseCompact($integer, $fNegative) |
|
184 | } |
||
185 |