source: rtems/testsuites/libtests/complex/docomplexf.c @ 7d3f9c6

4.115
Last change on this file since 7d3f9c6 was 7d3f9c6, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 07:37:03

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * Copyright (c) 2010 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
20void
21docomplexf (void)
22{
23#ifndef NO_FLOAT
24  complex float ca, cb, cc;
25  float f1;
26
27  ca = 1.0 + 1.0 * I;
28  cb = 1.0 - 1.0 * I;
29
30  f1 = cabsf (ca);
31  fprintf (stdout, "cabsf  : %f\n", f1);
32
33  cc = cacosf (ca);
34  fprintf (stdout, "cacosf : %f %fi\n", crealf (cc),
35           cimagf (cc));
36
37  cc = cacoshf (ca);
38  fprintf (stdout, "cacoshf: %f %fi\n", crealf (cc),
39           cimagf (cc));
40
41  f1 = cargf (ca);
42  fprintf (stdout, "cargf  : %f\n", f1);
43
44  cc = casinf (ca);
45  fprintf (stdout, "casinf : %f %fi\n", crealf (cc),
46           cimagf (cc));
47
48  cc = casinhf (ca);
49  fprintf (stdout, "casinhf: %f %fi\n", crealf (cc),
50           cimagf (cc));
51
52  cc = catanf (ca);
53  fprintf (stdout, "catanf : %f %fi\n", crealf (cc),
54           cimagf (cc));
55
56  cc = catanhf (ca);
57  fprintf (stdout, "catanhf: %f %fi\n", crealf (cc),
58           cimagf (cc));
59
60  cc = ccosf (ca);
61  fprintf (stdout, "ccosf  : %f %fi\n", crealf (cc),
62           cimagf (cc));
63
64  cc = ccoshf (ca);
65  fprintf (stdout, "ccoshf : %f %fi\n", crealf (cc),
66           cimagf (cc));
67
68  cc = cexpf (ca);
69  fprintf (stdout, "cexpf  : %f %fi\n", crealf (cc),
70           cimagf (cc));
71
72  f1 = cimagf (ca);
73  fprintf (stdout, "cimagf : %f\n", f1);
74
75  cc = clogf (ca);
76  fprintf (stdout, "clogf  : %f %fi\n", crealf (cc),
77           cimagf (cc));
78
79  cc = conjf (ca);
80  fprintf (stdout, "conjf  : %f %fi\n", crealf (cc),
81           cimagf (cc));
82
83  cc = cpowf (ca, cb);
84  fprintf (stdout, "cpowf  : %f %fi\n", crealf (cc),
85           cimagf (cc));
86
87  cc = cprojf (ca);
88  fprintf (stdout, "cprojf : %f %fi\n", crealf (cc),
89           cimagf (cc));
90
91  f1 = crealf (ca);
92  fprintf (stdout, "crealf : %f\n", f1);
93
94  cc = csinf (ca);
95  fprintf (stdout, "csinf  : %f %fi\n", crealf (cc),
96           cimagf (cc));
97
98  cc = csinhf (ca);
99  fprintf (stdout, "csinhf : %f %fi\n", crealf (cc),
100           cimagf (cc));
101
102  cc = csqrtf (ca);
103  fprintf (stdout, "csqrtf : %f %fi\n", crealf (cc),
104           cimagf (cc));
105
106  cc = ctanf (ca);
107  fprintf (stdout, "ctanf  : %f %fi\n", crealf (cc),
108           cimagf (cc));
109
110  cc = ctanhf (ca);
111  fprintf (stdout, "ctanhf : %f %fi\n", crealf (cc),
112           cimagf (cc));
113#endif
114}
Note: See TracBrowser for help on using the repository browser.