From fce03a798464e900fd2b1e23a423ab3438ff15a6 Mon Sep 17 00:00:00 2001 From: Karan Anand Date: Tue, 21 Apr 2026 05:15:58 -0400 Subject: [PATCH] bench: replace M_PI in `math/base/special/sincospi` C benchmark --- 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: na - 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: passed - 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 --- --- .../math/base/special/sincospi/benchmark/c/benchmark.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/sincospi/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/sincospi/benchmark/c/benchmark.c index e6877b709139..d35ffd07ca9a 100644 --- a/lib/node_modules/@stdlib/math/base/special/sincospi/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/sincospi/benchmark/c/benchmark.c @@ -25,6 +25,7 @@ #define NAME "sincospi" #define ITERATIONS 1000000 #define REPEATS 3 +#define PI 3.14159265358979323846 /** * Prints the TAP version. @@ -102,8 +103,8 @@ static double benchmark( void ) { t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - y = sin( M_PI * x[ i%100 ] ); - z = cos( M_PI * x[ i%100 ] ); + y = sin( PI * x[ i%100 ] ); + z = cos( PI * x[ i%100 ] ); if ( y != y || z != z ) { printf( "should not return NaN\n" ); break;