def __eq__(self, val):
if isinstance(val, UncertainFunction):<EOL><INDENT>diff = self - val<EOL>return not (diff.mean or diff.var or diff.skew or diff.kurt)<EOL><DEDENT>else:<EOL><INDENT>return len(self._mcpts[self._mcpts == val]) / float(npts)<EOL><DEDENT>
If we are comparing two distributions, check the resulting moments. If
they are the same distribution, then the moments will all be zero and
we can know that it is actually the same distribution we are comparing
``self`` to, otherwise, at least one statistical moment will be non-
zero.

If we are comparing ``self`` to a scalar, just do a normal comparison
so that if the underlying distribution looks like a PMF, a meaningful
probability of self==val is returned. This can still work quite safely
for PDF distributions since the likelihood of comparing self to an
actual sampled value is negligible when mcerp.npts is large.

Examples:

    >>> h = H(50, 5, 10)  # Hypergeometric distribution (PMF)
    >>> h==4  # what's the probability of getting 4 of the 5?
    0.004
    >>> sum([h==i for i in (0, 1, 2, 3, 4, 5)])  # sum of all discrete probabilities
    1.0

    >>> n = N(0, 1)  # Normal distribution (PDF)
    >>> n==0  # what's the probability of being exactly 0.0?
    0.0
    >>> n>0  # greater than 0.0?
    0.5
    >>> n<0  # less than 0.0?
    0.5
    >>> n==1  # exactly 1.0?
    0.0