Skip to content
Draft
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 @@ -32,7 +32,10 @@ static const double SQRT2LN2 = 1.1774100225154747; // sqrt(2*ln(2))
* // returns ~10.597
*/
double stdlib_base_dists_rayleigh_median( const double sigma ) {
if ( stdlib_base_is_nan( sigma ) || sigma < 0 ) {
if (
stdlib_base_is_nan( sigma ) ||
sigma < 0.0
) {
return 0.0 / 0.0; // NaN
}
return sigma * SQRT2LN2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
* // returns ~34.765
*/
double stdlib_base_dists_rayleigh_variance( const double sigma ) {
if ( stdlib_base_is_nan( sigma ) || sigma < 0.0 ) {
if (
stdlib_base_is_nan( sigma ) ||
sigma < 0.0
) {
return 0.0 / 0.0; // NaN
}
return ( 4.0 - STDLIB_CONSTANT_FLOAT64_PI ) * sigma * sigma / 2.0;
Expand Down