@@ 128-147 (lines=20) @@ | ||
125 | return ["number", abs($this->assertions->assertNumber($num)), $num[2]]; |
|
126 | } |
|
127 | ||
128 | public function min($args) |
|
129 | { |
|
130 | $values = $this->assertions->assertMinArgs($args, 1, "min"); |
|
131 | ||
132 | $first_format = $values[0][2]; |
|
133 | ||
134 | $min_index = 0; |
|
135 | $min_value = $values[0][1]; |
|
136 | ||
137 | for ($a = 0, $max = count($values); $a < $max; $a++) { |
|
138 | $converted = $this->convertMe($values[$a], $first_format); |
|
139 | ||
140 | if ($converted[1] < $min_value) { |
|
141 | $min_index = $a; |
|
142 | $min_value = $values[$a][1]; |
|
143 | } |
|
144 | } |
|
145 | ||
146 | return $values[$min_index]; |
|
147 | } |
|
148 | ||
149 | public function max($args) |
|
150 | { |
|
@@ 149-168 (lines=20) @@ | ||
146 | return $values[$min_index]; |
|
147 | } |
|
148 | ||
149 | public function max($args) |
|
150 | { |
|
151 | $values = $this->assertions->assertMinArgs($args, 1, "max"); |
|
152 | ||
153 | $first_format = $values[0][2]; |
|
154 | ||
155 | $max_index = 0; |
|
156 | $max_value = $values[0][1]; |
|
157 | ||
158 | for ($a = 0, $max = count($values); $a < $max; $a++) { |
|
159 | $converted = $this->convertMe($values[$a], $first_format); |
|
160 | ||
161 | if ($converted[1] > $max_value) { |
|
162 | $max_index = $a; |
|
163 | $max_value = $values[$a][1]; |
|
164 | } |
|
165 | } |
|
166 | ||
167 | return $values[$max_index]; |
|
168 | } |
|
169 | ||
170 | public function tan($num) |
|
171 | { |