xref: /PHP-7.4/ext/gmp/tests/gmp_div_qr.phpt (revision 782352c5)
1--TEST--
2gmp_div_qr() tests
3--SKIPIF--
4<?php if (!extension_loaded("gmp")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(gmp_div_qr());
9var_dump(gmp_div_qr(""));
10
11var_dump(gmp_div_qr(0,1));
12var_dump(gmp_div_qr(1,0));
13var_dump(gmp_div_qr(gmp_init(1), gmp_init(0)));
14var_dump(gmp_div_qr(12653,23482734));
15var_dump(gmp_div_qr(12653,23482734, 10));
16var_dump(gmp_div_qr(1123123,123));
17var_dump(gmp_div_qr(1123123,123, 1));
18var_dump(gmp_div_qr(1123123,123, 2));
19var_dump(gmp_div_qr(gmp_init(1123123), gmp_init(123)));
20var_dump(gmp_div_qr(1123123,123, GMP_ROUND_ZERO));
21var_dump(gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF));
22var_dump(gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF));
23
24$fp = fopen(__FILE__, 'r');
25
26var_dump(gmp_div_qr($fp, $fp));
27var_dump(gmp_div_qr(array(), array()));
28
29echo "Done\n";
30?>
31--EXPECTF--
32Warning: gmp_div_qr() expects at least 2 parameters, 0 given in %s on line %d
33NULL
34
35Warning: gmp_div_qr() expects at least 2 parameters, 1 given in %s on line %d
36NULL
37array(2) {
38  [0]=>
39  object(GMP)#%d (1) {
40    ["num"]=>
41    string(1) "0"
42  }
43  [1]=>
44  object(GMP)#%d (1) {
45    ["num"]=>
46    string(1) "0"
47  }
48}
49
50Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
51bool(false)
52
53Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
54bool(false)
55array(2) {
56  [0]=>
57  object(GMP)#%d (1) {
58    ["num"]=>
59    string(1) "0"
60  }
61  [1]=>
62  object(GMP)#%d (1) {
63    ["num"]=>
64    string(5) "12653"
65  }
66}
67
68Warning: gmp_div_qr(): Invalid rounding mode in %s on line %d
69bool(false)
70array(2) {
71  [0]=>
72  object(GMP)#%d (1) {
73    ["num"]=>
74    string(4) "9131"
75  }
76  [1]=>
77  object(GMP)#%d (1) {
78    ["num"]=>
79    string(2) "10"
80  }
81}
82array(2) {
83  [0]=>
84  object(GMP)#%d (1) {
85    ["num"]=>
86    string(4) "9132"
87  }
88  [1]=>
89  object(GMP)#%d (1) {
90    ["num"]=>
91    string(4) "-113"
92  }
93}
94array(2) {
95  [0]=>
96  object(GMP)#%d (1) {
97    ["num"]=>
98    string(4) "9131"
99  }
100  [1]=>
101  object(GMP)#%d (1) {
102    ["num"]=>
103    string(2) "10"
104  }
105}
106array(2) {
107  [0]=>
108  object(GMP)#%d (1) {
109    ["num"]=>
110    string(4) "9131"
111  }
112  [1]=>
113  object(GMP)#%d (1) {
114    ["num"]=>
115    string(2) "10"
116  }
117}
118array(2) {
119  [0]=>
120  object(GMP)#%d (1) {
121    ["num"]=>
122    string(4) "9131"
123  }
124  [1]=>
125  object(GMP)#%d (1) {
126    ["num"]=>
127    string(2) "10"
128  }
129}
130array(2) {
131  [0]=>
132  object(GMP)#%d (1) {
133    ["num"]=>
134    string(4) "9132"
135  }
136  [1]=>
137  object(GMP)#%d (1) {
138    ["num"]=>
139    string(4) "-113"
140  }
141}
142array(2) {
143  [0]=>
144  object(GMP)#%d (1) {
145    ["num"]=>
146    string(4) "9131"
147  }
148  [1]=>
149  object(GMP)#%d (1) {
150    ["num"]=>
151    string(2) "10"
152  }
153}
154
155Warning: gmp_div_qr(): Unable to convert variable to GMP - wrong type in %s on line %d
156bool(false)
157
158Warning: gmp_div_qr(): Unable to convert variable to GMP - wrong type in %s on line %d
159bool(false)
160Done
161