Skip to content
Closed
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 @@ -204,6 +204,10 @@ int main( void ) {

<!-- /.examples -->

</section>

<!-- ./c -->

<!-- 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. -->

<section class="references">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* Evaluates the quantile function for an exponential distribution with rate parameter `lambda` at a probability `p`.

* @param p - input probability
* @param lambda rate parameter
* @return quantile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, f
t.end();
});

tape( 'if provided a number outside `[0,1]` for `p` and a finite `lambda`, the function returns `NaN`', function test( t ) {
tape( 'if provided a number outside `[0,1]` for `p` and a finite `lambda`, the function returns `NaN`', opts, function test( t ) {
var y = quantile( 2.2, 1.0 );
t.equal( isnan( y ), true, 'returns true' );
y = quantile( -0.2, 1.0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ v = stdev( 1.5 );
// returns ~0.6080
```

If provided a success probability `λ` which is nonpositive, the function returns `NaN`.
If provided a shape parameter `λ` which is nonpositive, the function returns `NaN`.

```javascript
var v = stdev( NaN );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bench( pkg, function benchmark( b ) {
len = 100;
lambda = new Float64Array( len );
for ( i = 0; i < len; i++ ) {
lambda[ i ] = uniform( 1.0, 11.0 );
lambda[ i ] = uniform( 0.1, 11.0 );
}

b.tic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var addon = require( './../src/addon.node' );
*
* @private
* @param {number} lambda - shape parameter
* @returns {Probability} evaluated standard deviation
* @returns {PositiveNumber} evaluated standard deviation
*
* @example
* var v = stdev( 0.1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ double stdlib_base_dists_uniform_logpdf( const double x, const double a, const d
) {
return 0.0/0.0; // NaN
}
if ( x < a || x > b) {
if ( x < a || x > b ) {
return STDLIB_CONSTANT_FLOAT64_NINF;
}
return -stdlib_base_ln( b - a );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ int main( void ) {

<!-- /.examples -->

</section>

<!-- /.c -->


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

<section class="related">
Expand Down
Loading