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 @@ -171,7 +171,7 @@ Evaluates the [cumulative distribution function][cdf] (CDF) for a [Cauchy][cauch

```c
double out = stdlib_base_dists_cauchy_cdf( 0.5, 0.0, 2.0 );
// returns ~0.333
// returns ~0.578
```

The function accepts the following arguments:
Expand Down Expand Up @@ -213,9 +213,10 @@ static double random_uniform( const double min, const double max ) {
}

int main( void ) {
//correct order based on the length
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comments here and elsewhere in this PR need to be removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//correct order based on the length

double gamma;
double x;
double x0;
double x;
double y;
int i;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ var pkg = require( './../package.json' ).name;


// VARIABLES //

var logcdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
//corected variable name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//corected variable name

var cdf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( logcdf instanceof Error )
'skip': ( cdf instanceof Error )
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ static double random_uniform( const double min, const double max ) {
}

int main( void ) {
double gamma;
//corrected order
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//corrected order

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChaitraTM This order is not correct. The order should be in order of decreasing length, not increasing length.

int i;
double x;
double x0;
double y;
int i;
double x0;
double gamma;


for ( i = 0; i < 25; i++ ) {
x = random_uniform( 0.0, 10.0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
#endif

/**
* Evaluates the cumulative distribution function (CDF) for a Weibull distribution with shape parameter `k` and scale parameter `lambda` at a value `x`.
* Evaluates the cumulative distribution function (CDF) for a Cauchy distribution with location parameter `x0` and scale parameter `gamma` at a value `x`.
*/
double stdlib_base_dists_cauchy_cdf( const double x, const double x0, const double gamma );

Expand Down