1--TEST-- 2BcMath\Number div object by operator 3--EXTENSIONS-- 4bcmath 5--FILE-- 6<?php 7 8$values = [ 9 100, 10 '-20', 11 '0.01', 12 '-0.40', 13 3, 14]; 15 16foreach ($values as $value1) { 17 $num1 = new BcMath\Number($value1); 18 19 foreach ($values as $value2) { 20 echo "{$value1} / {$value2}\n"; 21 $num2 = new BcMath\Number($value2); 22 $ret = $num1 / $num2; 23 var_dump($ret); 24 echo "\n"; 25 } 26} 27?> 28--EXPECT-- 29100 / 100 30object(BcMath\Number)#3 (2) { 31 ["value"]=> 32 string(1) "1" 33 ["scale"]=> 34 int(0) 35} 36 37100 / -20 38object(BcMath\Number)#2 (2) { 39 ["value"]=> 40 string(2) "-5" 41 ["scale"]=> 42 int(0) 43} 44 45100 / 0.01 46object(BcMath\Number)#4 (2) { 47 ["value"]=> 48 string(5) "10000" 49 ["scale"]=> 50 int(0) 51} 52 53100 / -0.40 54object(BcMath\Number)#3 (2) { 55 ["value"]=> 56 string(4) "-250" 57 ["scale"]=> 58 int(0) 59} 60 61100 / 3 62object(BcMath\Number)#2 (2) { 63 ["value"]=> 64 string(13) "33.3333333333" 65 ["scale"]=> 66 int(10) 67} 68 69-20 / 100 70object(BcMath\Number)#4 (2) { 71 ["value"]=> 72 string(4) "-0.2" 73 ["scale"]=> 74 int(1) 75} 76 77-20 / -20 78object(BcMath\Number)#1 (2) { 79 ["value"]=> 80 string(1) "1" 81 ["scale"]=> 82 int(0) 83} 84 85-20 / 0.01 86object(BcMath\Number)#2 (2) { 87 ["value"]=> 88 string(5) "-2000" 89 ["scale"]=> 90 int(0) 91} 92 93-20 / -0.40 94object(BcMath\Number)#4 (2) { 95 ["value"]=> 96 string(2) "50" 97 ["scale"]=> 98 int(0) 99} 100 101-20 / 3 102object(BcMath\Number)#1 (2) { 103 ["value"]=> 104 string(13) "-6.6666666666" 105 ["scale"]=> 106 int(10) 107} 108 1090.01 / 100 110object(BcMath\Number)#2 (2) { 111 ["value"]=> 112 string(6) "0.0001" 113 ["scale"]=> 114 int(4) 115} 116 1170.01 / -20 118object(BcMath\Number)#3 (2) { 119 ["value"]=> 120 string(7) "-0.0005" 121 ["scale"]=> 122 int(4) 123} 124 1250.01 / 0.01 126object(BcMath\Number)#1 (2) { 127 ["value"]=> 128 string(4) "1.00" 129 ["scale"]=> 130 int(2) 131} 132 1330.01 / -0.40 134object(BcMath\Number)#2 (2) { 135 ["value"]=> 136 string(6) "-0.025" 137 ["scale"]=> 138 int(3) 139} 140 1410.01 / 3 142object(BcMath\Number)#3 (2) { 143 ["value"]=> 144 string(14) "0.003333333333" 145 ["scale"]=> 146 int(12) 147} 148 149-0.40 / 100 150object(BcMath\Number)#1 (2) { 151 ["value"]=> 152 string(6) "-0.004" 153 ["scale"]=> 154 int(3) 155} 156 157-0.40 / -20 158object(BcMath\Number)#4 (2) { 159 ["value"]=> 160 string(4) "0.02" 161 ["scale"]=> 162 int(2) 163} 164 165-0.40 / 0.01 166object(BcMath\Number)#3 (2) { 167 ["value"]=> 168 string(6) "-40.00" 169 ["scale"]=> 170 int(2) 171} 172 173-0.40 / -0.40 174object(BcMath\Number)#1 (2) { 175 ["value"]=> 176 string(4) "1.00" 177 ["scale"]=> 178 int(2) 179} 180 181-0.40 / 3 182object(BcMath\Number)#4 (2) { 183 ["value"]=> 184 string(15) "-0.133333333333" 185 ["scale"]=> 186 int(12) 187} 188 1893 / 100 190object(BcMath\Number)#3 (2) { 191 ["value"]=> 192 string(4) "0.03" 193 ["scale"]=> 194 int(2) 195} 196 1973 / -20 198object(BcMath\Number)#2 (2) { 199 ["value"]=> 200 string(5) "-0.15" 201 ["scale"]=> 202 int(2) 203} 204 2053 / 0.01 206object(BcMath\Number)#4 (2) { 207 ["value"]=> 208 string(3) "300" 209 ["scale"]=> 210 int(0) 211} 212 2133 / -0.40 214object(BcMath\Number)#3 (2) { 215 ["value"]=> 216 string(4) "-7.5" 217 ["scale"]=> 218 int(1) 219} 220 2213 / 3 222object(BcMath\Number)#2 (2) { 223 ["value"]=> 224 string(1) "1" 225 ["scale"]=> 226 int(0) 227} 228