DecimalMathTest::testShift()   A
last analyzed

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