blob: b5468db5b0872f0e1db52757e58b048386974d7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
/*//#include "sec.h"
//#include "cos.h"
//#include <math.h>
//#include "doubleComplex.h"
//#include "division.h"
*/
/*#include <math.h>
#include "sin.h"
#include "cos.h"
#include "sinh.h"
#include "cosh.h"
#include "csc.h"
#include "division.h"
*/
#include <complex.h>
#include <stdio.h>
/*doubleComplex zsecs(doubleComplex z)
{
doubleComplex out;
out = zrdivs(DoubleComplex(1,0),zcoss(z));
return out;
}
*/
void zsecs(double complex z)
{
//double complex out;
/*out = zrdivs(DoubleComplex(1,0),zcoss(z));
return out;
}*/
double complex out = 1.0/(ccos(z));
if(cimag(out)==0.0)
{
printf("%.7lf\n",creal(out));
//out=creal(out);
}
else if(creal(out)==0.0)
{
printf("%.7lfi\n",cimag(out));
//out=cimag(out);
}
else if(creal(out)!=0.0 && cimag(out)<0.0)
{
printf("%.7lf %.7lfi\n",creal(out),cimag(out));
//out=x;
}
else
{
printf("%.7lf + %.7lfi\n", creal(out), cimag(out));
//out=x;
}
//return out;
}
|