// Compile: cc -std=c23 test_annex_G_complex.c -lm
#include <complex.h>
#include <math.h>
#include <assert.h>
int main(void){
#if defined(__STDC_IEC_60559_COMPLEX__)
  double complex z = I*I;
  // i*i == -1
  assert(cabs(z + 1.0) < 1e-12);
  // exp(i*pi) == -1 (principal value)
  double pi = acos(-1.0);
  double complex w = cexp(I*pi);
  assert(cabs(w + 1.0) < 1e-12);
#endif
  return 0;
}
