Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sin_approximation
//g++ 5.4.0 #include <iostream> #include <math.h> using namespace std; int main() { cout<< "Enter x \n"; double x; cin >> x; cout<< "Enter eps \n"; double eps; cin >> x; double x1=x; double s=0.; int i=0; int j; int br=0; while (x1 >= eps) { if (i%2==0) s=s+x1; else s=s-x1; i++; j=2*i+1; x1=x1*x*x/j; br++; } cout << "The Result \n" << s; cout << br; }
run
|
edit
|
history
|
help
0
Get smallest dividers
kadane's algorithm 2
GenericPacker
passing by reference vs passing by value
LRU - Main
CPP Multi Inherit
Breakfast Static Function
fundamental type sizes
Overland pg. 68
synowie abrahama