MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / main

Function main

examples/isolated/complex_arithmetic.c:13–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13int main() {
14
15 initQuESTEnv();
16
17#if !defined(_MSC_VER)
18
19 qcomp x = 1.2 + 3.4i;
20
21 // C + R
22 x = x + (int) 3;
23 x = x + (qindex) 3;
24 x = x + (float) 2;
25 x = x + (double) 2;
26 x = x + (long double) 2;
27
28 // R + C
29 x = (int) 3 + x;
30 x = (qindex) 3 + x;
31 x = (float) 2 + x;
32 x = (double) 2 + x;
33 x = (long double) 2 + x;
34
35 // C - R
36 x = x - (int) 3;
37 x = x - (qindex) 3;
38 x = x - (float) 2;
39 x = x - (double) 2;
40 x = x - (long double) 2;
41
42 // R - C
43 x = (int) 3 - x;
44 x = (qindex) 3 - x;
45 x = (float) 2 - x;
46 x = (double) 2 - x;
47 x = (long double) 2 - x;
48
49 // C * R
50 x = x * (int) 3;
51 x = x * (qindex) 3;
52 x = x * (float) 2;
53 x = x * (double) 2;
54 x = x * (long double) 2;
55
56 // R * C
57 x = (int) 3 * x;
58 x = (qindex) 3 * x;
59 x = (float) 2 * x;
60 x = (double) 2 * x;
61 x = (long double) 2 * x;
62
63 // C / R
64 x = x / (int) 3;
65 x = x / (qindex) 3;
66 x = x / (float) 2;
67 x = x / (double) 2;
68 x = x / (long double) 2;
69
70 // R / C

Callers

nothing calls this directly

Calls 3

initQuESTEnvFunction · 0.85
reportScalarFunction · 0.85
finalizeQuESTEnvFunction · 0.85

Tested by

no test coverage detected