Skip to content
Snippets Groups Projects
Select Git revision
  • dualcore
  • ch3/leds
  • wip-bootstrap default
  • ch3/time
  • master
5 results

float1.py

Blame
    • Damien George's avatar
      d4b75f6b
      py/obj: Fix comparison of float/complex NaN with itself. · d4b75f6b
      Damien George authored
      IEEE floating point is specified such that a comparison of NaN with itself
      returns false, and Python respects these semantics.  This patch makes uPy
      also have these semantics.  The fix has a minor impact on the speed of the
      object-equality fast-path, but that seems to be unavoidable and it's much
      more important to have correct behaviour (especially in this case where
      the wrong answer for nan==nan is silently returned).
      d4b75f6b
      History
      py/obj: Fix comparison of float/complex NaN with itself.
      Damien George authored
      IEEE floating point is specified such that a comparison of NaN with itself
      returns false, and Python respects these semantics.  This patch makes uPy
      also have these semantics.  The fix has a minor impact on the speed of the
      object-equality fast-path, but that seems to be unavoidable and it's much
      more important to have correct behaviour (especially in this case where
      the wrong answer for nan==nan is silently returned).