corrected test to take into account double math precision errors