@@ -18,7 +18,6 @@ public function setup(): void
1818 {
1919 $ this ->inflector = InflectorFactory::create ()->build ();
2020 }
21-
2221 private function getTestValues ($ scale , $ precision ): iterable
2322 {
2423 $ values = [];
@@ -179,7 +178,21 @@ public function roundProvider(): iterable
179178 {
180179 $ huge = str_repeat ('1 ' , 35 ) . '. ' . str_repeat ('5 ' , 29 );
181180
182- return [
181+ if (version_compare (PHP_VERSION , '7.4.0 ' ) >= 0 ) {
182+ $ test_set = [
183+ ['decimal_18_20 ' , -1.0E-30 , '0.000000000000000000 ' ],
184+ ['decimal_19_20 ' , -1.0E-20 , '0.0000000000000000000 ' ],
185+ ['decimal_30_65 ' , -1.6E-130 , '0.000000000000000000000000000000 ' ],
186+ ];
187+ } else { // before php 7.4.0
188+ $ test_set = [
189+ ['decimal_18_20 ' , -1.0E-30 , '-0.000000000000000000 ' ],
190+ ['decimal_19_20 ' , -1.0E-20 , '-0.0000000000000000000 ' ],
191+ ['decimal_30_65 ' , -1.6E-130 , '-0.000000000000000000000000000000 ' ],
192+ ];
193+ }
194+
195+ $ test_set = array_merge ($ test_set , [
183196 ['decimal_0_10 ' , .5 , '1 ' ],
184197 ['decimal_0_10 ' , .499 , '0 ' ],
185198 ['decimal_0_10 ' , 1 , '1 ' ],
@@ -204,22 +217,21 @@ public function roundProvider(): iterable
204217 ['decimal_10_10 ' , 1.0E-30 , '0.0000000000 ' ],
205218
206219 ['decimal_18_20 ' , 1.0E-30 , '0.000000000000000000 ' ],
207- ['decimal_18_20 ' , -1.0E-30 , '-0.000000000000000000 ' ],
208220 ['decimal_18_20 ' , '12.3456789012345678915 ' , '12.345678901234567892 ' ],
209221 ['decimal_18_20 ' , '-12.3456789012345678915 ' , '-12.345678901234567892 ' ],
210222
211223 ['decimal_19_20 ' , 1.0E-30 , '0.0000000000000000000 ' ],
212- ['decimal_19_20 ' , -1.0E-20 , '-0.0000000000000000000 ' ],
213224 ['decimal_19_20 ' , '1.23456789012345678915 ' , '1.2345678901234567892 ' ],
214225 ['decimal_19_20 ' , '-1.23456789012345678915 ' , '-1.2345678901234567892 ' ],
215226
216227 ['decimal_30_65 ' , 1.0E-20 , '0.000000000000000000010000000000 ' ],
217228 ['decimal_30_65 ' , 1.6E-130 , '0.000000000000000000000000000000 ' ],
218- ['decimal_30_65 ' , -1.6E-130 , '-0.000000000000000000000000000000 ' ],
219229 ['decimal_30_65 ' , $ huge . '54 ' , $ huge . '5 ' ],
220230 ['decimal_30_65 ' , $ huge . '55 ' , $ huge . '6 ' ],
221231 ['decimal_30_65 ' , '- ' . $ huge . '55 ' , '- ' . $ huge . '6 ' ],
222- ];
232+ ]);
233+
234+ return $ test_set ;
223235 }
224236
225237 /**
0 commit comments