source: rtems/testsuites/libtests/complex/docomplexf.c @ 0c2d8ec

4.115
Last change on this file since 0c2d8ec was 0c2d8ec, checked in by Ralf Corsépius <ralf.corsepius@…>, on 05/23/12 at 14:44:33

Revert "libtests/complex: Avoid generated files"

This reverts commit a80a108d447d596e476611108cd468ec993be4a6.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Copyright (c) 2010, 2011 by
3 * Ralf Corsepius, Ulm/Germany. All rights reserved.
4 *
5 * Permission to use, copy, modify, and distribute this software
6 * is freely granted, provided that this notice is preserved.
7 */
8
9/*
10 * Try to compile and link against POSIX complex math routines.
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <complex.h>
18#include <stdio.h>
19
20extern void docomplexf (void);
21
22void
23docomplexf (void)
24{
25#ifndef NO_FLOAT
26  complex float ca, cb, cc;
27  float f1;
28
29  ca = 1.0 + 1.0 * I;
30  cb = 1.0 - 1.0 * I;
31
32  f1 = cabsf (ca);
33  fprintf (stdout, "cabsf  : %f\n", f1);
34
35  cc = cacosf (ca);
36  fprintf (stdout, "cacosf : %f %fi\n", crealf (cc),
37           cimagf (cc));
38
39  cc = cacoshf (ca);
40  fprintf (stdout, "cacoshf: %f %fi\n", crealf (cc),
41           cimagf (cc));
42
43  f1 = cargf (ca);
44  fprintf (stdout, "cargf  : %f\n", f1);
45
46  cc = casinf (ca);
47  fprintf (stdout, "casinf : %f %fi\n", crealf (cc),
48           cimagf (cc));
49
50  cc = casinhf (ca);
51  fprintf (stdout, "casinhf: %f %fi\n", crealf (cc),
52           cimagf (cc));
53
54  cc = catanf (ca);
55  fprintf (stdout, "catanf : %f %fi\n", crealf (cc),
56           cimagf (cc));
57
58  cc = catanhf (ca);
59  fprintf (stdout, "catanhf: %f %fi\n", crealf (cc),
60           cimagf (cc));
61
62  cc = ccosf (ca);
63  fprintf (stdout, "ccosf  : %f %fi\n", crealf (cc),
64           cimagf (cc));
65
66  cc = ccoshf (ca);
67  fprintf (stdout, "ccoshf : %f %fi\n", crealf (cc),
68           cimagf (cc));
69
70  cc = cexpf (ca);
71  fprintf (stdout, "cexpf  : %f %fi\n", crealf (cc),
72           cimagf (cc));
73
74  f1 = cimagf (ca);
75  fprintf (stdout, "cimagf : %f\n", f1);
76
77  cc = clogf (ca);
78  fprintf (stdout, "clogf  : %f %fi\n", crealf (cc),
79           cimagf (cc));
80
81  cc = conjf (ca);
82  fprintf (stdout, "conjf  : %f %fi\n", crealf (cc),
83           cimagf (cc));
84
85  cc = cpowf (ca, cb);
86  fprintf (stdout, "cpowf  : %f %fi\n", crealf (cc),
87           cimagf (cc));
88
89  cc = cprojf (ca);
90  fprintf (stdout, "cprojf : %f %fi\n", crealf (cc),
91           cimagf (cc));
92
93  f1 = crealf (ca);
94  fprintf (stdout, "crealf : %f\n", f1);
95
96  cc = csinf (ca);
97  fprintf (stdout, "csinf  : %f %fi\n", crealf (cc),
98           cimagf (cc));
99
100  cc = csinhf (ca);
101  fprintf (stdout, "csinhf : %f %fi\n", crealf (cc),
102           cimagf (cc));
103
104  cc = csqrtf (ca);
105  fprintf (stdout, "csqrtf : %f %fi\n", crealf (cc),
106           cimagf (cc));
107
108  cc = ctanf (ca);
109  fprintf (stdout, "ctanf  : %f %fi\n", crealf (cc),
110           cimagf (cc));
111
112  cc = ctanhf (ca);
113  fprintf (stdout, "ctanhf : %f %fi\n", crealf (cc),
114           cimagf (cc));
115#endif
116}
Note: See TracBrowser for help on using the repository browser.