Skip to content

chore: address commit comments (commit 3ee60b4 #5941

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 1 commit into from
Mar 17, 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 @@ -186,7 +186,7 @@ for ( i = 0; i < 25; i++ ) {

#### stdlib_base_dists_triangular_quantile( p, a, b, c )

Evaluates the [quantile function][quantile-function] for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode).
Evaluates the [quantile function][quantile-function] for a [triangular][triangular-distribution] distribution with parameters `a` (lower limit), `b` (upper limit), and `c` (mode).

```c
double out = stdlib_base_dists_triangular_quantile( 0.9, -1.0, 1.0, 0.0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static double benchmark( void ) {
int i;

for ( i = 0; i < 100; i++ ) {
p[ i ] = random_uniform( 0.0, 1.0);
p[ i ] = random_uniform( 0.0, 1.0 );
min[ i ] = random_uniform( 0.0, 10.0 );
max[ i ] = random_uniform( min[ i ], min[ i ]+10.0 );
mode[ i ] = random_uniform( min[ i ], max[ i ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
#endif

/**
* Evaluates the quantile function for a triangular distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode).
* Evaluates the quantile function for a triangular distribution with parameters `a` (lower limit), `b` (upper limit), and `c` (mode).
*/
double stdlib_base_dists_triangular_quantile( const double p, const double a, const double b, const double c );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ var addon = require( './../src/addon.node' );
// MAIN //

/**
* Evaluates the quantile function for a triangular distribution with lower limit `a` and upper limit `b` and mode `c` at a probability `p`.
*
* Evaluates the quantile function for a triangular distribution with parameters `a` (lower limit), `b` (upper limit), and `c` (mode).
* @private
* @param {Probability} p - input value
* @param {number} a - lower limit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "stdlib/math/base/special/sqrt.h"

/**
* Evaluates the quantile function for a triangular distribution with parameters `a` (lower limit), `b` (upper limit) and `c` (mode).
* Evaluates the quantile function for a triangular distribution with parameters `a` (lower limit), `b` (upper limit), and `c` (mode).
*
* @param p input probability
* @param a minimum support
Expand All @@ -48,7 +48,7 @@ double stdlib_base_dists_triangular_quantile( const double p, const double a, co
}
double pInflection = ( c - a ) / ( b - a );
if ( p < pInflection ) {
return a + stdlib_base_sqrt( ( b - a ) * ( c - a) * p );
return a + stdlib_base_sqrt( ( b - a ) * ( c - a ) * p );
}
if ( p > pInflection ) {
return b - stdlib_base_sqrt( ( b - a ) * ( b - c ) * ( 1.0 - p ) );
Expand Down