Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static float appr_sin(float x, int n){
- float X = x;
- int p=1;
- for(int i=1;i<=2*n+1;i+=2){
- res += p*X/factoriel( i ); p*=-1; X *= X*X;
- }
- return res;
- }
- public static int factoriel(int n){
- if( n==0 )
- return 1;
- return factoriel(n-1)*n;
- }
Advertisement
Add Comment
Please, Sign In to add comment