Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This compliant solution can be used if the programmers programmer's intent is was to only take the base-2 logarithm of the real part of the complex number:

Code Block
bgColor#ccccff
langc
#include <complex.h>
#include <tgmath.h>
 
void func(void) {
  double complex c = 2.0 + 4.0 * I;
  double complex result = log2(creal(c));
}

...