Skip to content

chore: address commit comments for commit 340a147 (issue #7427) #7434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ The function accepts the following arguments:
- **lambda**: `[in] double` shape parameter.

```c
double stdlib_base_dists_planck_logcdf
( const double x, const double lambda );
double stdlib_base_dists_planck_logcdf( const double x, const double lambda );
```

</section>
Expand Down Expand Up @@ -203,18 +202,14 @@ static double random_uniform( const double min, const double max ) {
return min + ( v*(max-min) );
}

static int discrete_uniform( const int min, const int max ) {
return min + (rand() % (max - min + 1));
}

int main( void ) {
double lambda;
double x;
double y;
int i;

for ( i = 0; i < 25; i++ ) {
x = discrete_uniform( 0, 40.0 );
x = random_uniform( 0.0, 40.0 );
lambda = random_uniform( 0.1, 5.0 );
y = stdlib_base_dists_planck_logcdf( x, lambda );
printf( "x: %lf, λ: %lf, ln(F(x;λ)): %lf\n", x, lambda, y );
Expand All @@ -230,7 +225,6 @@ int main( void ) {

<!-- /.c -->


<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ bench( pkg + '::native', opts, function benchmark( b ) {
lambda = new Float64Array( len );
x = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
x[i] = discreteUniform( 0, 40 );
lambda[i] = uniform( 1.0, 10.0 );
x[ i ] = discreteUniform( 0, 40 );
lambda[ i ] = uniform( 1.0, 10.0 );
}

b.tic();
Expand Down