From af6a6012cc7ad78df8c594160ae9947f57020448 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 2 Jan 2026 01:00:21 -0800 Subject: [PATCH] test(math/base/special/cosm1): add tests for signed zeros --- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- etc/eslint/.eslintrc.markdown.js | 11 +++++++---- .../@stdlib/math/base/special/cosm1/test/test.js | 13 +++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/etc/eslint/.eslintrc.markdown.js b/etc/eslint/.eslintrc.markdown.js index 3c2648c862ad..87241f35c894 100644 --- a/etc/eslint/.eslintrc.markdown.js +++ b/etc/eslint/.eslintrc.markdown.js @@ -20,10 +20,8 @@ // MODULES // -// FIXME: remove the next line and uncomment the subsequent line once all remark JSDoc ESLint rules are completed -var copy = require( './../../lib/node_modules/@stdlib/utils/copy' ); - -// Var copy = require( './utils/copy.js' ); +// FIXME: update the next line once all remark JSDoc ESLint rules are completed +var copy = require( './../../lib/node_modules/@stdlib/utils/copy' ); // var copy = require( './utils/copy.js' ); var defaults = require( './.eslintrc.js' ); @@ -125,6 +123,11 @@ eslint.rules[ 'stdlib/jsdoc-private-annotation' ] = 'off'; */ eslint.rules[ 'stdlib/jsdoc-return-annotations-values' ] = 'off'; // FIXME: remove this once we can reliably lint Markdown code blocks +/** +* Do not enforce disallowing empty lines between module-level require statements. +*/ +eslint.rules[ 'stdlib/no-empty-lines-between-requires' ] = 'off'; + /** * Allow use of undeclared variables, as variables may be defined in previous code blocks or be implied. * diff --git a/lib/node_modules/@stdlib/math/base/special/cosm1/test/test.js b/lib/node_modules/@stdlib/math/base/special/cosm1/test/test.js index 2ce201bc7a83..72b519368abb 100644 --- a/lib/node_modules/@stdlib/math/base/special/cosm1/test/test.js +++ b/lib/node_modules/@stdlib/math/base/special/cosm1/test/test.js @@ -51,6 +51,19 @@ tape( 'main export is a function', function test( t ) { t.end(); }); +tape( 'the function returns positive zero for zero and negative zero', function test( t ) { + var v1 = cosm1( 0.0 ); + var v2 = cosm1( -0.0 ); + + t.strictEqual( v1, 0.0, 'returns +0 for +0' ); + t.strictEqual( 1.0/v1, PINF, 'returns +0 (not -0)' ); + + t.strictEqual( v2, 0.0, 'returns +0 for -0' ); + t.strictEqual( 1.0/v2, PINF, 'returns +0 (not -0)' ); + + t.end(); +}); + tape( 'the function computes the cosine minus one more accurately inside the interval [-π/4,π/4]', function test( t ) { var expected; var x;