Skip to content

Commit 7bf3b2d

Browse files
committed
test: add note explaining tolerance differences
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent e77a2d5 commit 7bf3b2d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/node_modules/@stdlib/math/base/special/tan/test/test.native.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ tape( 'the function computes the tangent (large positive values)', opts, functio
141141

142142
for ( i = 0; i < x.length; i++ ) {
143143
y = tan( x[ i ] );
144+
145+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
144146
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
145147
}
146148
t.end();
@@ -157,6 +159,8 @@ tape( 'the function computes the tangent (large negative values)', opts, functio
157159

158160
for ( i = 0; i < x.length; i++ ) {
159161
y = tan( x[ i ] );
162+
163+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
160164
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
161165
}
162166
t.end();
@@ -173,6 +177,8 @@ tape( 'the function computes the tangent (medium positive values)', opts, functi
173177

174178
for ( i = 0; i < x.length; i++ ) {
175179
y = tan( x[ i ] );
180+
181+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
176182
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
177183
}
178184
t.end();
@@ -189,6 +195,8 @@ tape( 'the function computes the tangent (medium negative values)', opts, functi
189195

190196
for ( i = 0; i < x.length; i++ ) {
191197
y = tan( x[ i ] );
198+
199+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
192200
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
193201
}
194202
t.end();
@@ -205,6 +213,8 @@ tape( 'the function computes the tangent (small positive values)', opts, functio
205213

206214
for ( i = 0; i < x.length; i++ ) {
207215
y = tan( x[ i ] );
216+
217+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
208218
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
209219
}
210220
t.end();
@@ -221,6 +231,8 @@ tape( 'the function computes the tangent (small negative values)', opts, functio
221231

222232
for ( i = 0; i < x.length; i++ ) {
223233
y = tan( x[ i ] );
234+
235+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
224236
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
225237
}
226238
t.end();
@@ -237,6 +249,8 @@ tape( 'the function computes the tangent (smaller values)', opts, function test(
237249

238250
for ( i = 0; i < x.length; i++ ) {
239251
y = tan( x[ i ] );
252+
253+
// NOTE: the tolerance here is larger than for the JavaScript implementation due to compiler optimizations which may be performed resulting in result divergence. For discussion, see https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
240254
t.strictEqual( ulpdiff( y, expected[ i ] ) <= 1, true, 'returns expected value' );
241255
}
242256
t.end();

0 commit comments

Comments
 (0)