Skip to content

Commit 85ddf99

Browse files
committed
Fix stdlib-bot comments: reordered declarations, moved section, and used SQRT2
1 parent befe02c commit 85ddf99

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ for ( i = 0; i < 10; i++ ) {
152152

153153
<!-- /.examples -->
154154

155-
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
156-
157-
<section class="references">
158155

159156
<!-- C interface documentation. -->
160157

@@ -249,6 +246,18 @@ int main( void ) {
249246

250247
</section>
251248

249+
<!-- /.examples -->
250+
251+
</section>
252+
253+
<!-- /.c -->
254+
255+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
256+
257+
<section class="references">
258+
259+
</section>
260+
252261
<!-- /.references -->
253262

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

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/benchmark/c/benchmark.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ static double random_uniform( const double min, const double max ) {
9393
* @return elapsed time in seconds
9494
*/
9595
static double benchmark( void ) {
96-
double elapsed;
97-
double p[ 100 ];
98-
double mu[ 100 ];
99-
double sigma[ 100 ];
96+
int i;
10097
double y;
10198
double t;
102-
int i;
99+
double elapsed;
100+
double p[100];
101+
double mu[100];
102+
double sigma[100];
103103

104104
for ( i = 0; i < 100; i++ ) {
105105
p[ i ] = random_uniform( 0.0, 1.0 );

lib/node_modules/@stdlib/stats/base/dists/normal/quantile/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "stdlib/math/base/assert/is_nan.h"
2121
#include "stdlib/math/base/special/sqrt.h"
2222
#include "stdlib/math/base/special/erfinv.h"
23+
#include "@stdlib/constants/float64/sqrt-two.h"
2324

2425
/**
2526
* Evaluates the quantile function for a normal distribution with mean `mu` and standard deviation `sigma` at a probability `p`.
@@ -47,5 +48,5 @@ double stdlib_base_dists_normal_quantile( const double p, const double mu, const
4748
if ( sigma == 0.0 ) {
4849
return mu;
4950
}
50-
return mu + ( ( sigma * stdlib_base_sqrt( 2.0 ) ) * stdlib_base_erfinv( ( 2.0 * p ) - 1.0 ) );
51+
return mu + ( ( sigma * SQRT2 ) * stdlib_base_erfinv( ( 2.0 * p ) - 1.0 ) );
5152
}

0 commit comments

Comments
 (0)