/* Copyright 2003-2014 James F. Duff */
/* License and disclaimer: http://www.eight-cubed.com/disclaimer.html */

#define __NEW_STARLET 1

#include <stdio.h>
#include <complex.h>
#include <math.h>
#include <ots$routines.h>
#include <lib$routines.h>

#if __G_FLOAT != 0
#  define POWC ots$powcgcg_r3
   extern double complex ots$powcgcg_r3 (__unknown_params);
#elif __IEEE_FLOAT != 0
#  define POWC ots$powctct_r3
   extern double complex ots$powctct_r3 (__unknown_params);
#else
#  error "Try specifying a floating point qualifier on the compile"
#endif


/******************************************************************************/
int main (void) {

static double complex c1 = 2.0 + 3.0*I;
static double complex c2 = 1.0 + 2.0*I;
static double complex r;

    r = cpow (c1, c2);
    (void)printf ("%f + i%f\n",
                 creal (r),
                 cimag (r));

    r = POWC (creal (c1),
              cimag (c1),
              creal (c2),
              cimag (c2));
    (void)printf ("%f + i%f\n",
                 creal (r),
                 cimag (r));
}    

Back to the master examples list.