TODO: this does not use HAVE_C99_COMPLEX as in R, perhaps it should
| 65 | inline double complex__Arg( Rcomplex x ){ return ::atan2(x.i, x.r); } |
| 66 | // TODO: this does not use HAVE_C99_COMPLEX as in R, perhaps it should |
| 67 | inline Rcomplex complex__exp( Rcomplex x){ |
| 68 | Rcomplex y ; |
| 69 | double expx = ::exp(x.r); |
| 70 | y.r = expx * ::cos(x.i); |
| 71 | y.i = expx * ::sin(x.i); |
| 72 | return y ; |
| 73 | } |
| 74 | inline Rcomplex complex__log( Rcomplex x){ |
| 75 | Rcomplex y ; |
| 76 | y.i = ::atan2(x.i, x.r); |