sin(x)的实现
来源:互联网 发布:网络安全技术课后答案 编辑:程序博客网 时间:2024/05/21 03:28
#include<iostream>using namespace std;
//定义为double类型,防止溢出。double GetValue1(int k){if(k==0 || k==1)return 1;else return k*GetValue1(k-1);}double GetValue2(int k,double x){double temp=1.0;for(int i=0;i<2*k+1;i++)temp=temp*x;double temp2=GetValue1(2*k+1);if(k%2==0)temp=temp/temp2;else temp=0-temp/temp2;return temp;}double Sin(double x){static int k=0;double temp=GetValue2(k,x);if(temp>-0.00001 && temp<0.00001)return temp;else {k++;return temp+Sin(x);}}void main(){double pi=3.14;cout<<Sin(pi/4)<<endl;}
0 0
- sin(x)的实现
- sin(x)函数的源代码?
- 求sin(x)的近似值
- sin(x)的计算
- tensorflow LSTM实现sin(x)预测
- 实现sin(x)曲线与cos(x)曲线图形的同时显示
- 利用C语言实现sin(x)曲线与cos(x)曲线图形的同时显示
- sin(x)的泰勒级数展开运算
- 绘制y=sin(x)/x的图形
- 快速sin()和cos()的实现
- 三角函数sin和cos的实现
- 求sin x
- 求sin(x)数值
- 求正弦函数sin(x)的近似值的多项式求解
- Ex5_4_2 求sin(x)的泰勒展开(方法二)
- Integral of sin(x)/x
- 当x趋于0如何证明sin(x)/x的极限为1
- 泰勒展开式求sin(x)
- 我们敬重你,java之父
- 旋转数组的最小数字
- 2015.9.19蘑菇街WEB前端笔试体会
- redis实战之使用redis保存最近浏览的商品数据
- 编程练习(1)
- sin(x)的实现
- hdu 5464(01背包)
- TCP的连接管理
- netbeans中表格使用
- CSS Sprite的使用
- 百度测试开发9/16/2015
- nodejs+express+mongodb简单的例子
- 我的2015
- sizeof()和strlen()不得不说的故事