1 | // Copyright (c) Microsoft. All rights reserved. |
2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
3 | |
4 | #include "native.h" |
5 | |
6 | struct MyValueType { |
7 | float count; |
8 | float sum; |
9 | float average; |
10 | float count1; |
11 | float sum1; |
12 | float average1; |
13 | float count2; |
14 | float sum2; |
15 | float average2; |
16 | float count3; |
17 | float sum3; |
18 | float average3; |
19 | float count4; |
20 | float sum4; |
21 | float average4; |
22 | float count5; |
23 | float sum5; |
24 | float average5; |
25 | }; |
26 | |
27 | |
28 | MCC_API MyValueType WINAPI sum( |
29 | float a01, float a02, float a03, |
30 | float a04, float a05, float a06, |
31 | float a07, float a08, float a09, |
32 | float a10, float a11, float a12) { |
33 | MyValueType result; |
34 | |
35 | int count = 12; |
36 | float sum = a01 + a02 + a03 + a04 + a05 + a06 + a07 + a08 + a09 + a10 + a11 + a12; |
37 | |
38 | result.count = (float)count; |
39 | result.sum = sum; |
40 | result.average = result.sum / result.count; |
41 | |
42 | result.count1 = (float)count; |
43 | result.sum1 = sum; |
44 | result.average1 = result.sum1 / result.count1; |
45 | |
46 | result.count2 = (float)count; |
47 | result.sum2 = sum; |
48 | result.average2 = result.sum2 / result.count2; |
49 | |
50 | result.count3 = (float)count; |
51 | result.sum3 = sum; |
52 | result.average3 = result.sum3 / result.count3; |
53 | |
54 | result.count4 = (float)count; |
55 | result.sum4 = sum; |
56 | result.average4 = result.sum4 / result.count4; |
57 | |
58 | result.count5 = (float)count; |
59 | result.sum5 = sum; |
60 | result.average5 = result.sum5 / result.count5; |
61 | |
62 | return result; |
63 | } |
64 | |