@@ -140,7 +140,7 @@ are approximately equal to each other. The subroutine can be called in numerous
140
140
ways that let you test using relative tolerance (C < $rel-tol > ) or
141
141
absolute tolerance (C < $abs-tol > ) of different values.
142
142
143
- If no tolerance is set, it will default to absolute tolerance of C < 1e-5 >
143
+ If no tolerance is set, it will default to an absolute tolerance of C < 1e-5 > .
144
144
145
145
my Numeric ($value, $expected, $abs-tol, $rel-tol) = ...
146
146
@@ -161,7 +161,7 @@ If no tolerance is set, it will default to absolute tolerance of C<1e-5>
161
161
162
162
= head3 Absolute Tolerance
163
163
164
- When absolute tolerance is set, it's used as the actual maximum value by
164
+ When an absolute tolerance is set, it's used as the actual maximum value by
165
165
which the C < $value > and C < $expected > can differ. For example:
166
166
167
167
is-approx 3, 4, 2; # success
@@ -172,11 +172,11 @@ which the C<$value> and C<$expected> can differ. For example:
172
172
is-approx 300, 600, 2; # fail
173
173
174
174
Regardless of values given, the difference between them cannot be more
175
- than C < 2 >
175
+ than C < 2 > .
176
176
177
177
= head3 Relative Tolerance
178
178
179
- When relative tolerance is set, the test checks relative difference between
179
+ When a relative tolerance is set, the test checks the relative difference between
180
180
values. Given the same tolerance, the larger the numbers given, the larger the
181
181
value they can differ by can be.
182
182
@@ -193,16 +193,16 @@ by about C<1> while the second can differ by about C<10>. The function used
193
193
to calculate the difference is:
194
194
195
195
= begin code
196
- |got - expected|
196
+ |value - expected|
197
197
β£rel-diff = ββββββββββββββββββββββ
198
- max(|got |, |expected|)
198
+ max(|value |, |expected|)
199
199
= end code
200
200
201
201
And the test will fail if C < rel-diff > is higher than C < $rel-tol >
202
202
203
203
= head3 Both Absolute and Relative Tolerance Specified
204
204
205
- is-approx $got , $expected, :rel-tol<.5>, :abs-tol<10>;
205
+ is-approx $value , $expected, :rel-tol<.5>, :abs-tol<10>;
206
206
207
207
When both absolute and relative tolerances are specified, each will be
208
208
tested independently, and the C < is-approx > test will succeed only if both pass.
0 commit comments