Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -44,7 +44,8 @@
"@stdlib/math/base/special/sqrt",
"@stdlib/math/base/special/pow",
"@stdlib/math/base/special/exp",
"@stdlib/constants/float64/pinf"
"@stdlib/constants/float64/pinf",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -65,7 +66,8 @@
"@stdlib/math/base/special/pow",
"@stdlib/math/base/special/exp",
"@stdlib/constants/float64/pinf",
"@stdlib/constants/float64/eps"
"@stdlib/constants/float64/eps",
"@stdlib/constants/float64/nan"
]
},
{
Expand All @@ -86,7 +88,8 @@
"@stdlib/math/base/special/pow",
"@stdlib/math/base/special/exp",
"@stdlib/constants/float64/pinf",
"@stdlib/constants/float64/eps"
"@stdlib/constants/float64/eps",
"@stdlib/constants/float64/nan"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "stdlib/math/base/special/exp.h"
#include "stdlib/constants/float64/two_pi.h"
#include "stdlib/constants/float64/pinf.h"
#include "stdlib/constants/float64/nan.h"

/**
* Evaluates the probability density function (PDF) for a normal distribution with mean `mu` and standard deviation `sigma` at a value `x`.
Expand All @@ -46,7 +47,7 @@ double stdlib_base_dists_normal_pdf( const double x, const double mu, const doub
stdlib_base_is_nan( sigma ) ||
sigma < 0.0
) {
return 0.0/0.0; // NaN
return STDLIB_CONSTANT_FLOAT64_NAN;
}
if ( sigma == 0.0 ) {
return ( x == mu ) ? STDLIB_CONSTANT_FLOAT64_PINF : 0.0;
Expand Down
Loading