Approximately equal arrays
The assert_approx_equal()
function raises an exception if two numbers are not equal up to a certain number of significant digits. The function raises an exception triggered by the following condition:
abs(actual - expected) >= 10**-(significant - 1)
Get NumPy : Beginner's Guide - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.