code: def test_special_values(self):
      # C99: Sec G 6.4.2
  
      check = check_complex_value
      f = np.sqrt
  
      # csqrt(+-0 + 0i) is 0 + 0i
      check(f, np.PZERO, 0, 0, 0)
      check(f, np.NZERO, 0, 0, 0)
  
      # csqrt(x + infi) is inf + infi for any x (including NaN)
      check(f, 1, np.inf, np.inf, np.inf)
      check(f, -1, np.inf, np.inf, np.inf)
  
      check(f, np.PZERO, np.inf, np.inf, np.inf)
      check(f, np.NZERO, np.inf, np.inf, np.inf)
      check(f, np.inf, np.inf, np.inf, np.inf)
      check(f, -np.inf, np.inf, np.inf, np.inf)
      check(f, -np.nan, np.inf, np.inf, np.inf)
  
      # csqrt(x + nani) is nan + nani for any finite x
      check(f, 1, np.nan, np.nan, np.nan)
      check(f, -1, np.nan, np.nan, np.nan)
      check(f, 0, np.nan, np.nan, np.nan)
  
      # csqrt(-inf + yi) is +0 + infi for any finite y > 0
      check(f, -np.inf, 1, np.PZERO, np.inf)
  
      # csqrt(inf + yi) is +inf + 0i for any finite y > 0
      check(f, np.inf, 1, np.inf, np.PZERO)
  
      # csqrt(-inf + nani) is nan +- infi (both +i infi are valid)
      def _check_ninf_nan(dummy):
          msgform = (
              "csqrt(-inf, nan) is (%f, %f), expected (nan, +-inf)"
          )
          z = np.sqrt(np.array(complex(-np.inf, np.nan)))
          # Fixme: ugly workaround for isinf bug.
          with np.errstate(invalid="ignore"):
              if not (np.isnan(z.real) and np.isinf(z.imag)):
                  raise AssertionError(msgform % (z.real, z.imag))
  
      _check_ninf_nan(None)
  
      # csqrt(+inf + nani) is inf + nani
      check(f, np.inf, np.nan, np.inf, np.nan)
  
      # csqrt(nan + yi) is nan + nani for any finite y (infinite handled in x
      # + nani)
      check(f, np.nan, 0, np.nan, np.nan)
      check(f, np.nan, 1, np.nan, np.nan)
      check(f, np.nan, np.nan, np.nan, np.nan)
  
imports: import sys
  import platform
  import pytest
  import numpy
  import numpy.core._multiarray_umath
  from numpy.testing import assert_raises, assert_equal, assert_array_equal, assert_almost_equal, assert_array_max_ulp
label_desc: Use image node_id 3 for calling the TestCsqrt obj's underlying member method code with example usage: obj.test_special_values() without return types