1--TEST--
2round(): Test RoundingMode enum.
3--FILE--
4<?php
5foreach (RoundingMode::cases() as $mode) {
6    foreach ([
7        1.0,
8        -1.0,
9        1.2,
10        -1.2,
11        1.7,
12        -1.7,
13        1.5,
14        -1.5,
15        2.5,
16        -2.5
17    ] as $number) {
18        printf("%-20s: %+.17g -> %+.17g\n", $mode->name, $number, round($number, 0, $mode));
19    }
20}
21?>
22--EXPECT--
23HalfAwayFromZero    : +1 -> +1
24HalfAwayFromZero    : -1 -> -1
25HalfAwayFromZero    : +1.2 -> +1
26HalfAwayFromZero    : -1.2 -> -1
27HalfAwayFromZero    : +1.7 -> +2
28HalfAwayFromZero    : -1.7 -> -2
29HalfAwayFromZero    : +1.5 -> +2
30HalfAwayFromZero    : -1.5 -> -2
31HalfAwayFromZero    : +2.5 -> +3
32HalfAwayFromZero    : -2.5 -> -3
33HalfTowardsZero     : +1 -> +1
34HalfTowardsZero     : -1 -> -1
35HalfTowardsZero     : +1.2 -> +1
36HalfTowardsZero     : -1.2 -> -1
37HalfTowardsZero     : +1.7 -> +2
38HalfTowardsZero     : -1.7 -> -2
39HalfTowardsZero     : +1.5 -> +1
40HalfTowardsZero     : -1.5 -> -1
41HalfTowardsZero     : +2.5 -> +2
42HalfTowardsZero     : -2.5 -> -2
43HalfEven            : +1 -> +1
44HalfEven            : -1 -> -1
45HalfEven            : +1.2 -> +1
46HalfEven            : -1.2 -> -1
47HalfEven            : +1.7 -> +2
48HalfEven            : -1.7 -> -2
49HalfEven            : +1.5 -> +2
50HalfEven            : -1.5 -> -2
51HalfEven            : +2.5 -> +2
52HalfEven            : -2.5 -> -2
53HalfOdd             : +1 -> +1
54HalfOdd             : -1 -> -1
55HalfOdd             : +1.2 -> +1
56HalfOdd             : -1.2 -> -1
57HalfOdd             : +1.7 -> +2
58HalfOdd             : -1.7 -> -2
59HalfOdd             : +1.5 -> +1
60HalfOdd             : -1.5 -> -1
61HalfOdd             : +2.5 -> +3
62HalfOdd             : -2.5 -> -3
63TowardsZero         : +1 -> +1
64TowardsZero         : -1 -> -1
65TowardsZero         : +1.2 -> +1
66TowardsZero         : -1.2 -> -1
67TowardsZero         : +1.7 -> +1
68TowardsZero         : -1.7 -> -1
69TowardsZero         : +1.5 -> +1
70TowardsZero         : -1.5 -> -1
71TowardsZero         : +2.5 -> +2
72TowardsZero         : -2.5 -> -2
73AwayFromZero        : +1 -> +1
74AwayFromZero        : -1 -> -1
75AwayFromZero        : +1.2 -> +2
76AwayFromZero        : -1.2 -> -2
77AwayFromZero        : +1.7 -> +2
78AwayFromZero        : -1.7 -> -2
79AwayFromZero        : +1.5 -> +2
80AwayFromZero        : -1.5 -> -2
81AwayFromZero        : +2.5 -> +3
82AwayFromZero        : -2.5 -> -3
83NegativeInfinity    : +1 -> +1
84NegativeInfinity    : -1 -> -1
85NegativeInfinity    : +1.2 -> +1
86NegativeInfinity    : -1.2 -> -2
87NegativeInfinity    : +1.7 -> +1
88NegativeInfinity    : -1.7 -> -2
89NegativeInfinity    : +1.5 -> +1
90NegativeInfinity    : -1.5 -> -2
91NegativeInfinity    : +2.5 -> +2
92NegativeInfinity    : -2.5 -> -3
93PositiveInfinity    : +1 -> +1
94PositiveInfinity    : -1 -> -1
95PositiveInfinity    : +1.2 -> +2
96PositiveInfinity    : -1.2 -> -1
97PositiveInfinity    : +1.7 -> +2
98PositiveInfinity    : -1.7 -> -1
99PositiveInfinity    : +1.5 -> +2
100PositiveInfinity    : -1.5 -> -1
101PositiveInfinity    : +2.5 -> +3
102PositiveInfinity    : -2.5 -> -2
103