[Numpy-discussion] deprecations for 1.6; assert_almost_equal

Pauli Virtanen pav@iki...
Mon Mar 7 07:37:24 CST 2011

Mon, 07 Mar 2011 08:30:11 -0500, josef.pktd wrote:
> assert_approx_equal  checks for signigicant digits in decimal system,
> which looks like it's easy to interpret.

Ditto for tolerance=1e-7, which has the advantage that it's what
"print abs(desired-actual)" prints.

> I don't have much idea what a nulp is, and whether it's machine
> dependent.

It's the number of floating point values between the desired and the 
actual results --- this depends only on the fp type. It is *the* correct 
measure when you want "uniform" accuracy across the range of all floating 
point values. For instance, this is quite useful for special functions, 
whose range of values typically vary widely, but for which one still 
wants to have accuracy which is as good as possible.

Pauli Virtanen

More information about the NumPy-Discussion mailing list