Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cf = Compile[{},
- Block[{part, sum1 = 0., sum2 = 0., n = 0},
- Do[
- part = RandomReal[1, 10000];
- sum1 += Total[part];
- sum2 += Total[part^2];
- n += 10000;
- ,
- {100}
- ];
- {sum1, sum2}/n
- ],
- {{sum1, _Real, 0}, {sum2, _Real, 0}, {n, _Integer, 0}, {part, _Real,
- 1}}
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement