Passed
Push — rel0101 ( f8bb40...776ece )
by Jeroen De
07:08
created

DecimalMathTest::testProductLengthOverrun()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace DataValues\Tests;
4
5
use DataValues\DecimalMath;
6
use DataValues\DecimalValue;
7
8
/**
9
 * @covers DataValues\DecimalMath
10
 *
11
 * @group DataValue
12
 * @group DataValueExtensions
13
 *
14
 * @license GPL-2.0+
15
 * @author Daniel Kinzler
16
 */
17
class DecimalMathTest extends \PHPUnit_Framework_TestCase {
18
19
	/**
20
	 * @dataProvider bumpProvider
21
	 */
22
	public function testBump( DecimalValue $value, $expected ) {
23
		$math = new DecimalMath();
24
		$actual = $math->bump( $value );
25
		$this->assertSame( $expected, $actual->getValue() );
26
	}
27
28
	public function bumpProvider() {
29
		return [
30
			[ new DecimalValue( '+0' ), '+1' ],
31
			[ new DecimalValue( '-0' ), '+1' ],
32
			[ new DecimalValue( '+0.0' ), '+0.1' ],
33
			[ new DecimalValue( '-0.0' ), '+0.1' ],
34
			[ new DecimalValue( '+1' ), '+2' ],
35
			[ new DecimalValue( '-1' ), '-2' ],
36
			[ new DecimalValue( '+10' ), '+11' ],
37
			[ new DecimalValue( '-10' ), '-11' ],
38
			[ new DecimalValue( '+9' ), '+10' ],
39
			[ new DecimalValue( '-9' ), '-10' ],
40
			[ new DecimalValue( '+0.01' ), '+0.02' ],
41
			[ new DecimalValue( '-0.01' ), '-0.02' ],
42
			[ new DecimalValue( '+0.09' ), '+0.10' ],
43
			[ new DecimalValue( '-0.09' ), '-0.10' ],
44
			[ new DecimalValue( '+0.9' ), '+1.0' ],
45
			[ new DecimalValue( '-0.9' ), '-1.0' ],
46
		];
47
	}
48
49
	/**
50
	 * @dataProvider slumpProvider
51
	 */
52
	public function testSlump( DecimalValue $value, $expected ) {
53
		$math = new DecimalMath();
54
		$actual = $math->slump( $value );
55
		$this->assertSame( $expected, $actual->getValue() );
56
	}
57
58
	public function slumpProvider() {
59
		return [
60
			[ new DecimalValue( '+0' ), '-1' ],
61
			[ new DecimalValue( '-0' ), '-1' ],
62
			[ new DecimalValue( '+0.0' ), '-0.1' ],
63
			[ new DecimalValue( '-0.0' ), '-0.1' ],
64
			[ new DecimalValue( '+0.00' ), '-0.01' ],
65
			[ new DecimalValue( '-0.00' ), '-0.01' ],
66
			[ new DecimalValue( '+1' ), '+0' ],
67
			[ new DecimalValue( '-1' ), '+0' ],
68
			[ new DecimalValue( '+1.0' ), '+0.9' ],
69
			[ new DecimalValue( '-1.0' ), '-0.9' ],
70
			[ new DecimalValue( '+0.1' ), '+0.0' ],
71
			[ new DecimalValue( '-0.1' ), '+0.0' ], // zero is always normalized to be positive
72
			[ new DecimalValue( '+0.01' ), '+0.00' ],
73
			[ new DecimalValue( '-0.01' ), '+0.00' ], // zero is always normalized to be positive
74
			[ new DecimalValue( '+12' ), '+11' ],
75
			[ new DecimalValue( '-12' ), '-11' ],
76
			[ new DecimalValue( '+10' ), '+9' ],
77
			[ new DecimalValue( '-10' ), '-9' ],
78
			[ new DecimalValue( '+100' ), '+99' ],
79
			[ new DecimalValue( '-100' ), '-99' ],
80
			[ new DecimalValue( '+0.02' ), '+0.01' ],
81
			[ new DecimalValue( '-0.02' ), '-0.01' ],
82
			[ new DecimalValue( '+0.10' ), '+0.09' ],
83
			[ new DecimalValue( '-0.10' ), '-0.09' ],
84
		];
85
	}
86
87
	/**
88
	 * @dataProvider productProvider
89
	 */
90
	public function testProduct( DecimalValue $a, DecimalValue $b, $value ) {
91
		// FIXME: This should set $useBC to false (bcmath is tested below)
92
		$math = new DecimalMath( /* $useBC */ true );
93
94
		$actual = $math->product( $a, $b );
95
		$this->assertSame( $value, $actual->getValue() );
96
97
		$actual = $math->product( $b, $a );
98
		$this->assertSame( $value, $actual->getValue() );
99
	}
100
101
	public function productProvider() {
102
		return [
103
			[ new DecimalValue( '+0' ), new DecimalValue( '+0' ), '+0' ],
104
			[ new DecimalValue( '+0' ), new DecimalValue( '+1' ), '+0' ],
105
			[ new DecimalValue( '+0' ), new DecimalValue( '+2' ), '+0' ],
106
107
			[ new DecimalValue( '+1' ), new DecimalValue( '+0' ), '+0' ],
108
			[ new DecimalValue( '+1' ), new DecimalValue( '+1' ), '+1' ],
109
			[ new DecimalValue( '+1' ), new DecimalValue( '+2' ), '+2' ],
110
111
			[ new DecimalValue( '+2' ), new DecimalValue( '+0' ), '+0' ],
112
			[ new DecimalValue( '+2' ), new DecimalValue( '+1' ), '+2' ],
113
			[ new DecimalValue( '+2' ), new DecimalValue( '+2' ), '+4' ],
114
115
			[ new DecimalValue( '+0.5' ), new DecimalValue( '+0' ), '+0.0' ],
116
			[ new DecimalValue( '+0.5' ), new DecimalValue( '+1' ), '+0.5' ],
117
			[ new DecimalValue( '+0.5' ), new DecimalValue( '+2' ), '+1.0' ],
118
		];
119
	}
120
121
	/**
122
	 * @dataProvider productWithBCProvider
123
	 */
124
	public function testProductWithBC( DecimalValue $a, DecimalValue $b, $value ) {
125
		$math = new DecimalMath();
126
127
		$actual = $math->product( $a, $b );
128
		$this->assertSame( $value, $actual->getValue() );
129
130
		$actual = $math->product( $b, $a );
131
		$this->assertSame( $value, $actual->getValue() );
132
	}
133
134
	public function productWithBCProvider() {
135
		return [
136
			[ new DecimalValue( '+0.1' ), new DecimalValue( '+0.1' ), '+0.01' ],
137
			[ new DecimalValue( '-5000000' ), new DecimalValue( '-0.1' ), '+500000.0' ],
138
		];
139
	}
140
141
	/**
142
	 * @dataProvider productLengthOverrunProvider
143
	 */
144
	public function testProductLengthOverrun( DecimalValue $a, DecimalValue $b ) {
145
		$math = new DecimalMath();
146
		$actual = $math->product( $a, $b );
147
148
		$this->assertSame( 127, strlen( $actual->getValue() ) );
149
	}
150
151
	public function productLengthOverrunProvider() {
152
		return [
153
			[
154
				new DecimalValue( '+0.' . str_repeat( '3', 124 ) ),
155
				new DecimalValue( '+0.' . str_repeat( '6', 124 ) )
156
			],
157
			[
158
				new DecimalValue( '+' . str_repeat( '9', 126 ) ),
159
				new DecimalValue( '+0.' . str_repeat( '9', 124 ) )
160
			],
161
		];
162
	}
163
164
	/**
165
	 * @dataProvider sumProvider
166
	 */
167
	public function testSum( DecimalValue $a, DecimalValue $b, $value ) {
168
		$math = new DecimalMath();
169
170
		$actual = $math->sum( $a, $b );
171
		$this->assertSame( $value, $actual->getValue() );
172
173
		$actual = $math->sum( $b, $a );
174
		$this->assertSame( $value, $actual->getValue() );
175
	}
176
177
	public function sumProvider() {
178
		return [
179
			[ new DecimalValue( '+0' ), new DecimalValue( '+0' ), '+0' ],
180
			[ new DecimalValue( '+0' ), new DecimalValue( '+1' ), '+1' ],
181
			[ new DecimalValue( '+0' ), new DecimalValue( '+2' ), '+2' ],
182
183
			[ new DecimalValue( '+2' ), new DecimalValue( '+0' ), '+2' ],
184
			[ new DecimalValue( '+2' ), new DecimalValue( '+1' ), '+3' ],
185
			[ new DecimalValue( '+2' ), new DecimalValue( '+2' ), '+4' ],
186
187
			[ new DecimalValue( '+0.5' ), new DecimalValue( '+0' ), '+0.5' ],
188
			[ new DecimalValue( '+0.5' ), new DecimalValue( '+0.5' ), '+1.0' ],
189
			[ new DecimalValue( '+0.5' ), new DecimalValue( '+2' ), '+2.5' ],
190
		];
191
	}
192
193
	/**
194
	 * @dataProvider minMaxProvider
195
	 */
196
	public function testMin( DecimalValue $min, DecimalValue $max ) {
197
		$math = new DecimalMath();
198
199
		$actual = $math->min( $min, $max );
200
		$this->assertSame( $min->getValue(), $actual->getValue() );
201
202
		$actual = $math->min( $max, $min );
203
		$this->assertSame( $min->getValue(), $actual->getValue() );
204
	}
205
206
	/**
207
	 * @dataProvider minMaxProvider
208
	 */
209
	public function testMax( DecimalValue $min, DecimalValue $max ) {
210
		$math = new DecimalMath();
211
212
		$actual = $math->max( $min, $max );
213
		$this->assertSame( $max->getValue(), $actual->getValue() );
214
215
		$actual = $math->max( $max, $min );
216
		$this->assertSame( $max->getValue(), $actual->getValue() );
217
	}
218
219
	public function minMaxProvider() {
220
		return [
221
			[ new DecimalValue( '+0' ), new DecimalValue( '+0' ) ],
222
			[ new DecimalValue( '+1' ), new DecimalValue( '+1' ) ],
223
			[ new DecimalValue( '-0.2' ), new DecimalValue( '-0.2' ) ],
224
225
			[ new DecimalValue( '-2' ), new DecimalValue( '+1' ) ],
226
			[ new DecimalValue( '+0.33333' ), new DecimalValue( '+1' ) ],
227
		];
228
	}
229
230
	/**
231
	 * @dataProvider roundToDigitProvider
232
	 */
233
	public function testRoundToDigit( DecimalValue $value, $digits, $expected ) {
234
		$math = new DecimalMath();
235
236
		$actual = $math->roundToDigit( $value, $digits );
237
		$this->assertSame( $expected, $actual->getValue() );
238
	}
239
240
	public function roundToDigitProvider() {
241
		$argLists = [];
242
243
		//NOTE: Rounding is applied using the "round half away from zero" logic.
244
245
		$argLists[] = [ new DecimalValue( '-2' ), 0, '+0' ]; // no digits left
246
247
		$argLists[] = [ new DecimalValue( '+0' ), 1, '+0' ];
248
		$argLists[] = [ new DecimalValue( '+0' ), 2, '+0' ];
249
		$argLists[] = [ new DecimalValue( '+0.0' ), 1, '+0' ];
250
		$argLists[] = [ new DecimalValue( '+0.0' ), 2, '+0' ];
251
		$argLists[] = [ new DecimalValue( '+0.0' ), 3, '+0.0' ];
252
253
		$argLists[] = [ new DecimalValue( '+1.45' ), 1, '+1' ];
254
		$argLists[] = [ new DecimalValue( '+1.45' ), 3, '+1.5' ];
255
		$argLists[] = [ new DecimalValue( '+1.45' ), 4, '+1.45' ];
256
257
		$argLists[] = [ new DecimalValue( '-1.45' ), 1, '-1' ];
258
		$argLists[] = [ new DecimalValue( '-1.45' ), 3, '-1.5' ];
259
		$argLists[] = [ new DecimalValue( '-1.45' ), 4, '-1.45' ];
260
261
		$argLists[] = [ new DecimalValue( '+9.99' ), 1, '+10' ];
262
		$argLists[] = [ new DecimalValue( '+9.99' ), 3, '+10.0' ];
263
		$argLists[] = [ new DecimalValue( '+9.99' ), 4, '+9.99' ];
264
265
		$argLists[] = [ new DecimalValue( '+135.7' ), 1, '+100' ];
266
		$argLists[] = [ new DecimalValue( '+135.7' ), 3, '+136' ];
267
		$argLists[] = [ new DecimalValue( '+135.7' ), 5, '+135.7' ];
268
269
		$argLists[] = [ new DecimalValue( '-2' ), 1, '-2' ];
270
		$argLists[] = [ new DecimalValue( '-2' ), 2, '-2' ];
271
272
		$argLists[] = [ new DecimalValue( '+23' ), 1, '+20' ];
273
		$argLists[] = [ new DecimalValue( '+23' ), 2, '+23' ];
274
		$argLists[] = [ new DecimalValue( '+23' ), 3, '+23' ];
275
		$argLists[] = [ new DecimalValue( '+23' ), 4, '+23' ];
276
277
		$argLists[] = [ new DecimalValue( '-234' ), 1, '-200' ];
278
		$argLists[] = [ new DecimalValue( '-234' ), 2, '-230' ];
279
		$argLists[] = [ new DecimalValue( '-234' ), 3, '-234' ];
280
281
		$argLists[] = [ new DecimalValue( '-2.0' ), 1, '-2' ];
282
		$argLists[] = [ new DecimalValue( '-2.0' ), 2, '-2' ];   // not padded (can't end with decimal point)
283
		$argLists[] = [ new DecimalValue( '-2.0' ), 3, '-2.0' ];
284
		$argLists[] = [ new DecimalValue( '-2.0' ), 4, '-2.0' ]; // no extra digits
285
286
		$argLists[] = [ new DecimalValue( '-2.000' ), 1, '-2' ];
287
		$argLists[] = [ new DecimalValue( '-2.000' ), 2, '-2' ];
288
		$argLists[] = [ new DecimalValue( '-2.000' ), 3, '-2.0' ];
289
		$argLists[] = [ new DecimalValue( '-2.000' ), 4, '-2.00' ];
290
291
		$argLists[] = [ new DecimalValue( '+2.5' ), 1, '+3' ]; // rounded up
292
		$argLists[] = [ new DecimalValue( '+2.5' ), 2, '+3' ];
293
		$argLists[] = [ new DecimalValue( '+2.5' ), 3, '+2.5' ];
294
		$argLists[] = [ new DecimalValue( '+2.5' ), 4, '+2.5' ];
295
296
		$argLists[] = [ new DecimalValue( '+2.05' ), 1, '+2' ];
297
		$argLists[] = [ new DecimalValue( '+2.05' ), 2, '+2' ];
298
		$argLists[] = [ new DecimalValue( '+2.05' ), 3, '+2.1' ]; // rounded up
299
		$argLists[] = [ new DecimalValue( '+2.05' ), 4, '+2.05' ];
300
301
		$argLists[] = [ new DecimalValue( '-23.05' ), 1, '-20' ];
302
		$argLists[] = [ new DecimalValue( '-23.05' ), 2, '-23' ];
303
		$argLists[] = [ new DecimalValue( '-23.05' ), 3, '-23' ]; // not padded (can't end with decimal point)
304
		$argLists[] = [ new DecimalValue( '-23.05' ), 4, '-23.1' ]; // rounded down
305
		$argLists[] = [ new DecimalValue( '-23.05' ), 5, '-23.05' ];
306
307
		$argLists[] = [ new DecimalValue( '+9.33' ), 1, '+9' ]; // no rounding
308
		$argLists[] = [ new DecimalValue( '+9.87' ), 1, '+10' ]; // rounding ripples up
309
		$argLists[] = [ new DecimalValue( '+9.87' ), 3, '+9.9' ]; // rounding ripples up
310
		$argLists[] = [ new DecimalValue( '+99' ), 1, '+100' ]; // rounding ripples up
311
		$argLists[] = [ new DecimalValue( '+99' ), 2, '+99' ]; // rounding ripples up
312
313
		$argLists[] = [ new DecimalValue( '-9.33' ), 1, '-9' ]; // no rounding
314
		$argLists[] = [ new DecimalValue( '-9.87' ), 1, '-10' ]; // rounding ripples down
315
		$argLists[] = [ new DecimalValue( '-9.87' ), 3, '-9.9' ]; // rounding ripples down
316
		$argLists[] = [ new DecimalValue( '-99' ), 1, '-100' ]; // rounding ripples down
317
		$argLists[] = [ new DecimalValue( '-99' ), 2, '-99' ]; // rounding ripples down
318
319
		return $argLists;
320
	}
321
322
	/**
323
	 * @dataProvider getPositionForExponentProvider
324
	 */
325
	public function testGetPositionForExponent( $exponent, DecimalValue $decimal, $expected ) {
326
		$math = new DecimalMath();
327
328
		$actual = $math->getPositionForExponent( $exponent, $decimal );
329
		$this->assertSame( $expected, $actual );
330
	}
331
332
	public function getPositionForExponentProvider() {
333
		$argLists = [];
334
335
		$argLists[] = [ 0, new DecimalValue( '+0' ), 1 ];
336
		$argLists[] = [ 1, new DecimalValue( '+10.25' ), 1 ];
337
		$argLists[] = [ 1, new DecimalValue( '-100.25' ), 2 ];
338
		$argLists[] = [ 2, new DecimalValue( '+100.25' ), 1 ];
339
		$argLists[] = [ -2, new DecimalValue( '+0.234' ), 4 ];
340
		$argLists[] = [ -2, new DecimalValue( '+11.234' ), 5 ];
341
342
		return $argLists;
343
	}
344
345
	/**
346
	 * @dataProvider roundToExponentProvider
347
	 */
348
	public function testRoundToExponent( DecimalValue $value, $digits, $expected ) {
349
		$math = new DecimalMath();
350
351
		$actual = $math->roundToExponent( $value, $digits );
352
		$this->assertSame( $expected, $actual->getValue() );
353
	}
354
355
	public function roundToExponentProvider() {
356
		$argLists = [];
357
358
		//NOTE: Rounding is applied using the "round half away from zero" logic.
359
360
		$argLists[] = [ new DecimalValue( '+0' ), 0, '+0' ];
361
		$argLists[] = [ new DecimalValue( '+0' ), 1, '+0' ];
362
		$argLists[] = [ new DecimalValue( '+0.0' ), 0, '+0' ];
363
		$argLists[] = [ new DecimalValue( '+0.0' ), 2, '+0' ];
364
		$argLists[] = [ new DecimalValue( '+0.0' ), -5, '+0.0' ]; // no extra digits
365
366
		$argLists[] = [ new DecimalValue( '+1.45' ), 0, '+1' ];
367
		$argLists[] = [ new DecimalValue( '+1.45' ), 2, '+0' ];
368
		$argLists[] = [ new DecimalValue( '+1.45' ), -5, '+1.45' ];
369
370
		$argLists[] = [ new DecimalValue( '+99.99' ), 0, '+100' ];
371
		$argLists[] = [ new DecimalValue( '+99.99' ), 2, '+0' ];
372
		$argLists[] = [ new DecimalValue( '+99.99' ), -1, '+100.0' ];
373
		$argLists[] = [ new DecimalValue( '+99.99' ), -5, '+99.99' ];
374
375
		$argLists[] = [ new DecimalValue( '-2' ), 0, '-2' ];
376
		$argLists[] = [ new DecimalValue( '-2' ), -1, '-2' ];
377
		$argLists[] = [ new DecimalValue( '-2' ), 1, '+0' ];
378
379
		$argLists[] = [ new DecimalValue( '+23' ), 0, '+23' ];
380
		$argLists[] = [ new DecimalValue( '+23' ), 1, '+20' ];
381
		$argLists[] = [ new DecimalValue( '+23' ), 2, '+0' ];
382
383
		$argLists[] = [ new DecimalValue( '-234' ), 2, '-200' ];
384
		$argLists[] = [ new DecimalValue( '-234' ), 1, '-230' ];
385
		$argLists[] = [ new DecimalValue( '-234' ), 0, '-234' ];
386
387
		$argLists[] = [ new DecimalValue( '-2.0' ), 0, '-2' ];
388
		$argLists[] = [ new DecimalValue( '-2.0' ), -1, '-2.0' ];
389
		$argLists[] = [ new DecimalValue( '-2.0' ), -2, '-2.0' ]; // no extra digits
390
391
		$argLists[] = [ new DecimalValue( '-2.000' ), 0, '-2' ];
392
		$argLists[] = [ new DecimalValue( '-2.000' ), -1, '-2.0' ];
393
		$argLists[] = [ new DecimalValue( '-2.000' ), -2, '-2.00' ];
394
395
		$argLists[] = [ new DecimalValue( '+2.5' ), 0, '+3' ]; // rounded up
396
		$argLists[] = [ new DecimalValue( '+2.5' ), -1, '+2.5' ];
397
		$argLists[] = [ new DecimalValue( '+2.5' ), -2, '+2.5' ]; // no extra digits
398
399
		$argLists[] = [ new DecimalValue( '+2.05' ), 0, '+2' ];
400
		$argLists[] = [ new DecimalValue( '+2.05' ), -1, '+2.1' ]; // rounded up
401
		$argLists[] = [ new DecimalValue( '+2.05' ), -2, '+2.05' ];
402
403
		$argLists[] = [ new DecimalValue( '-23.05' ), 1, '-20' ];
404
		$argLists[] = [ new DecimalValue( '-23.05' ), 0, '-23' ];
405
406
		$argLists[] = [ new DecimalValue( '-23.05' ), -1, '-23.1' ]; // rounded down
407
		$argLists[] = [ new DecimalValue( '-23.05' ), -2, '-23.05' ];
408
409
		$argLists[] = [ new DecimalValue( '+9.33' ), 0, '+9' ]; // no rounding
410
		$argLists[] = [ new DecimalValue( '+9.87' ), 0, '+10' ]; // rounding ripples up
411
		$argLists[] = [ new DecimalValue( '+9.87' ), -1, '+9.9' ]; // rounding ripples up
412
		$argLists[] = [ new DecimalValue( '+99' ), 1, '+100' ]; // rounding ripples up
413
		$argLists[] = [ new DecimalValue( '+99' ), 0, '+99' ]; // rounding ripples up
414
415
		$argLists[] = [ new DecimalValue( '-9.33' ), 0, '-9' ]; // no rounding
416
		$argLists[] = [ new DecimalValue( '-9.87' ), 0, '-10' ]; // rounding ripples down
417
		$argLists[] = [ new DecimalValue( '-9.87' ), -1, '-9.9' ]; // rounding ripples down
418
		$argLists[] = [ new DecimalValue( '-99' ), 1, '-100' ]; // rounding ripples down
419
		$argLists[] = [ new DecimalValue( '-99' ), 0, '-99' ]; // rounding ripples down
420
421
		return $argLists;
422
	}
423
424
	/**
425
	 * @dataProvider shiftProvider
426
	 */
427
	public function testShift( DecimalValue $value, $exponent, $expected ) {
428
		$math = new DecimalMath();
429
430
		$actual = $math->shift( $value, $exponent );
431
		$this->assertSame( $expected, $actual->getValue() );
432
	}
433
434
	public function shiftProvider() {
435
		$argLists = [];
436
437
		$argLists[] = [ new DecimalValue( '+0' ), 0, '+0' ];
438
		$argLists[] = [ new DecimalValue( '+0' ), 1, '+0' ];
439
		$argLists[] = [ new DecimalValue( '+0' ), 2, '+0' ];
440
		$argLists[] = [ new DecimalValue( '+0' ), -1, '+0.0' ];
441
		$argLists[] = [ new DecimalValue( '+0' ), -2, '+0.00' ];
442
443
		$argLists[] = [ new DecimalValue( '+0.0' ), 0, '+0.0' ];
444
		$argLists[] = [ new DecimalValue( '+0.0' ), 1, '+0' ];
445
		$argLists[] = [ new DecimalValue( '+0.0' ), 2, '+0' ];
446
		$argLists[] = [ new DecimalValue( '+0.0' ), -1, '+0.00' ];
447
		$argLists[] = [ new DecimalValue( '+0.0' ), -2, '+0.000' ];
448
449
		$argLists[] = [ new DecimalValue( '-125' ), 0, '-125' ];
450
		$argLists[] = [ new DecimalValue( '-125' ), 1, '-1250' ];
451
		$argLists[] = [ new DecimalValue( '-125' ), 2, '-12500' ];
452
		$argLists[] = [ new DecimalValue( '-125' ), -1, '-12.5' ];
453
		$argLists[] = [ new DecimalValue( '-125' ), -2, '-1.25' ];
454
		$argLists[] = [ new DecimalValue( '-125' ), -3, '-0.125' ];
455
		$argLists[] = [ new DecimalValue( '-125' ), -4, '-0.0125' ];
456
457
		$argLists[] = [ new DecimalValue( '-2.5' ), 0, '-2.5' ];
458
		$argLists[] = [ new DecimalValue( '-2.5' ), 1, '-25' ];
459
		$argLists[] = [ new DecimalValue( '-2.5' ), 2, '-250' ];
460
		$argLists[] = [ new DecimalValue( '-2.5' ), -1, '-0.25' ];
461
		$argLists[] = [ new DecimalValue( '-2.5' ), -2, '-0.025' ];
462
		$argLists[] = [ new DecimalValue( '-2.5' ), -3, '-0.0025' ];
463
464
		$argLists[] = [ new DecimalValue( '+5' ), -4, '+0.0005' ];
465
		$argLists[] = [ new DecimalValue( '+5.0' ), -4, '+0.00050' ];
466
		$argLists[] = [ new DecimalValue( '+5.00' ), -4, '+0.000500' ];
467
468
		return $argLists;
469
	}
470
471
}
472