Skip to content

Commit d080e93

Browse files
committed
tidy grammar and punctuation; use consistent var names
1 parent 14462dc commit d080e93

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

β€Ždoc/Language/testing.pod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ are approximately equal to each other. The subroutine can be called in numerous
140140
ways that let you test using relative tolerance (C<$rel-tol>) or
141141
absolute tolerance (C<$abs-tol>) of different values.
142142
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>.
144144
145145
my Numeric ($value, $expected, $abs-tol, $rel-tol) = ...
146146
@@ -161,7 +161,7 @@ If no tolerance is set, it will default to absolute tolerance of C<1e-5>
161161
162162
=head3 Absolute Tolerance
163163
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
165165
which the C<$value> and C<$expected> can differ. For example:
166166
167167
is-approx 3, 4, 2; # success
@@ -172,11 +172,11 @@ which the C<$value> and C<$expected> can differ. For example:
172172
is-approx 300, 600, 2; # fail
173173
174174
Regardless of values given, the difference between them cannot be more
175-
than C<2>
175+
than C<2>.
176176
177177
=head3 Relative Tolerance
178178
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
180180
values. Given the same tolerance, the larger the numbers given, the larger the
181181
value they can differ by can be.
182182
@@ -193,16 +193,16 @@ by about C<1> while the second can differ by about C<10>. The function used
193193
to calculate the difference is:
194194
195195
=begin code
196-
|got - expected|
196+
|value - expected|
197197
⁣rel-diff = ──────────────────────
198-
max(|got|, |expected|)
198+
max(|value|, |expected|)
199199
=end code
200200
201201
And the test will fail if C<rel-diff> is higher than C<$rel-tol>
202202
203203
=head3 Both Absolute and Relative Tolerance Specified
204204
205-
is-approx $got, $expected, :rel-tol<.5>, :abs-tol<10>;
205+
is-approx $value, $expected, :rel-tol<.5>, :abs-tol<10>;
206206
207207
When both absolute and relative tolerances are specified, each will be
208208
tested independently, and the C<is-approx> test will succeed only if both pass.

0 commit comments

Comments
Β (0)