docstr: Make sure comparisons are working right
docstr_tok: ["Make","sure","comparisons","are","working","right"]
code: def test_half_ordering(self):
      """Make sure comparisons are working right"""
  
      # All non-NaN float16 values in reverse order
      a = self.nonan_f16[::-1].copy()
  
      # 32-bit float copy
      b = np.array(a, dtype=float32)
  
      # Should sort the same
      a.sort()
      b.sort()
      assert_equal(a, b)
  
      # Comparisons should work
      assert_((a[:-1] <= a[1:]).all())
      assert_(not (a[:-1] > a[1:]).any())
      assert_((a[1:] >= a[:-1]).all())
      assert_(not (a[1:] < a[:-1]).any())
      # All != except for +/-0
      assert_equal(np.nonzero(a[:-1] < a[1:])[0].size, a.size - 2)
      assert_equal(np.nonzero(a[1:] > a[:-1])[0].size, a.size - 2)
  
imports: import platform
  import pytest
  import numpy
  from numpy import uint16, float16, float32, float64
  from numpy.testing import assert_, assert_equal, _OLD_PROMOTION, IS_WASM
label_desc: Use image node_id 11 for calling the TestHalf obj's underlying member method code with example usage: obj.test_half_ordering() without return types