Testing floating point equality

  • For comparing numbers, there is math.isclose.
  • For comparing numbers or arrays, there is numpy.allclose.
  • For testing numbers or arrays, there is numpy.testing.assert_allclose

Leave a Comment