Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <numeric>
- #include <vector>
- #include <algorithm>
- #include <cmath>
- #include <cstdio>
- int main()
- {
- std::vector<float> fs(64*1024*1024,0);
- int i = 0;
- for(float& f : fs){
- f = float(i) / float(fs.size());
- i ++;
- }
- std::for_each(fs.begin(), fs.end(), [](float& f){f=std::sinf((f));});
- //std::for_each(fs.begin(), fs.end(), [](float& f){f=std::sin(double(f));});
- float x = std::accumulate(fs.begin(), fs.end(), 0.0);
- printf("%.4f\n", x);
- }
Advertisement
Add Comment
Please, Sign In to add comment