Skip to content

Commit 2f0b70a

Browse files
committed
refactor: example.c
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 7ef6273 commit 2f0b70a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/node_modules/@stdlib/stats/base/dists/chi/entropy/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ double stdlib_base_dists_chi_entropy( const double k );
182182
#include <stdlib.h>
183183
#include <stdio.h>
184184
185-
static double random_positive( const double min, const double max ) {
185+
static double random_uniform( const double min, const double max ) {
186186
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
187187
return min + ( v * ( max - min ) );
188188
}
@@ -193,7 +193,7 @@ int main( void ) {
193193
int i;
194194
195195
for ( i = 0; i < 10; i++ ) {
196-
k = random_positive( 0.1, 10.0 );
196+
k = random_uniform( 0.1, 10.0 ); // Ensure `k` > 0
197197
result = stdlib_base_dists_chi_entropy( k );
198198
199199
printf( "k: %lf, Entropy: %lf \n", k, result );

lib/node_modules/@stdlib/stats/base/dists/chi/entropy/examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <stdlib.h>
2121
#include <stdio.h>
2222

23-
static double random_positive( const double min, const double max ) {
23+
static double random_uniform( const double min, const double max ) {
2424
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
2525
return min + ( v * ( max - min ) );
2626
}
@@ -31,7 +31,7 @@ int main( void ) {
3131
int i;
3232

3333
for ( i = 0; i < 10; i++ ) {
34-
k = random_positive( 0.1, 10.0 );
34+
k = random_uniform( 0.1, 10.0 ); // Ensure `k` > 0
3535
result = stdlib_base_dists_chi_entropy( k );
3636

3737
printf( "k: %lf, Entropy: %lf \n", k, result );

0 commit comments

Comments
 (0)