numpy/numpy — pull request #5347 by rnelsonchem (2014-12-05 16:55:46+00:00)
Title: TST: Fix TestArrayAlmostEqualNulp

This fix addresses Issue #347.

All of the tests in this class were using random numbers generated without a
seed. In certain cases, this broke `test_simple` in a nondeterministic manner.
Part of the problem for this function is that `nulp` was being set to
2*max(random deviations). This value could be less than one depending on the
random numbers generated. Reset `nulp=1` which is the smallest value that
makes sense. Create a random array of deviations and force them to be in the
range [-1., 1.], because the abs(randn) can occasionally be > 1.

The assertion in test_big_float32 used a `nulp=1000`, which seemed excessive
for this particular test. Changed this to `nulp=1`, because that corresponds
to a value of ~1024 for this test case.

Documentation and random seeds were added to all of the other functions in
this class to make things more explicit.