From 10c7136ec0aee362c87fba61c6b6b01ee5d7ba37 Mon Sep 17 00:00:00 2001 From: akash shukla Date: Sat, 8 Mar 2025 14:43:18 +0530 Subject: [PATCH] Fix benchmark logic as per issue #5862 --- .../math/base/special/binet/benchmark/c/benchmark.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/binet/benchmark/c/benchmark.c b/lib/node_modules/@stdlib/math/base/special/binet/benchmark/c/benchmark.c index b86cc7628650..b868f1632601 100644 --- a/lib/node_modules/@stdlib/math/base/special/binet/benchmark/c/benchmark.c +++ b/lib/node_modules/@stdlib/math/base/special/binet/benchmark/c/benchmark.c @@ -50,7 +50,7 @@ static void print_summary( int total, int passing ) { } /** -* Prints benchmarks results. +* Prints benchmark results. * * @param elapsed elapsed time in seconds */ @@ -107,21 +107,18 @@ static double benchmark( void ) { int i; for ( i = 0; i < 100; i++ ) { - x[ i ] = floor( 79.0*rand_double() ); + x[ i ] = floor( 79.0 * rand_double() ); } t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { - y = stdlib_base_binet( x[ i%100 ] ); + y = binet( x[ i % 100 ] ); if ( y < 0 ) { printf( "should return a nonnegative number\n" ); break; } } elapsed = tic() - t; - if ( y < 0 ) { - printf( "should return a nonnegative number\n" ); - } return elapsed; } @@ -143,4 +140,6 @@ int main( void ) { printf( "ok %d benchmark finished\n", i+1 ); } print_summary( REPEATS, REPEATS ); + + return 0; }