code: def test_special_values(self):
      # C99: Section G 6.3.1
  
      check = check_complex_value
      f = np.exp
  
      # cexp(+-0 + 0i) is 1 + 0i
      check(f, np.PZERO, 0, 1, 0, False)
      check(f, np.NZERO, 0, 1, 0, False)
  
      # cexp(x + infi) is nan + nani for finite x and raises 'invalid' FPU
      # exception
      check(f, 1, np.inf, np.nan, np.nan)
      check(f, -1, np.inf, np.nan, np.nan)
      check(f, 0, np.inf, np.nan, np.nan)
  
      # cexp(inf + 0i) is inf + 0i
      check(f, np.inf, 0, np.inf, 0)
  
      # cexp(-inf + yi) is +0 * (cos(y) + i sin(y)) for finite y
      check(f, -np.inf, 1, np.PZERO, np.PZERO)
      check(f, -np.inf, 0.75 * np.pi, np.NZERO, np.PZERO)
  
      # cexp(inf + yi) is +inf * (cos(y) + i sin(y)) for finite y
      check(f, np.inf, 1, np.inf, np.inf)
      check(f, np.inf, 0.75 * np.pi, -np.inf, np.inf)
  
      # cexp(-inf + inf i) is +-0 +- 0i (signs unspecified)
      def _check_ninf_inf(dummy):
          msgform = "cexp(-inf, inf) is (%f, %f), expected (+-0, +-0)"
          with np.errstate(invalid="ignore"):
              z = f(np.array(complex(-np.inf, np.inf)))
              if z.real != 0 or z.imag != 0:
                  raise AssertionError(msgform % (z.real, z.imag))
  
      _check_ninf_inf(None)
  
      # cexp(inf + inf i) is +-inf + NaNi and raised invalid FPU ex.
      def _check_inf_inf(dummy):
          msgform = "cexp(inf, inf) is (%f, %f), expected (+-inf, nan)"
          with np.errstate(invalid="ignore"):
              z = f(np.array(complex(np.inf, np.inf)))
              if not np.isinf(z.real) or not np.isnan(z.imag):
                  raise AssertionError(msgform % (z.real, z.imag))
  
      _check_inf_inf(None)
  
      # cexp(-inf + nan i) is +-0 +- 0i
      def _check_ninf_nan(dummy):
          msgform = "cexp(-inf, nan) is (%f, %f), expected (+-0, +-0)"
          with np.errstate(invalid="ignore"):
              z = f(np.array(complex(-np.inf, np.nan)))
              if z.real != 0 or z.imag != 0:
                  raise AssertionError(msgform % (z.real, z.imag))
  
      _check_ninf_nan(None)
  
      # cexp(inf + nan i) is +-inf + nan
      def _check_inf_nan(dummy):
          msgform = "cexp(-inf, nan) is (%f, %f), expected (+-inf, nan)"
          with np.errstate(invalid="ignore"):
              z = f(np.array(complex(np.inf, np.nan)))
              if not np.isinf(z.real) or not np.isnan(z.imag):
                  raise AssertionError(msgform % (z.real, z.imag))
  
      _check_inf_nan(None)
  
      # cexp(nan + yi) is nan + nani for y != 0 (optional: raises invalid FPU
      # ex)
      check(f, np.nan, 1, np.nan, np.nan)
      check(f, np.nan, -1, np.nan, np.nan)
  
      check(f, np.nan, np.inf, np.nan, np.nan)
      check(f, np.nan, -np.inf, np.nan, np.nan)
  
      # cexp(nan + nani) is nan + nani
      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 2 for calling the TestCexp obj's underlying member method code with example usage: obj.test_special_values() without return types