首页 文章
  • 2 votes
     answers
     views

    计算sinh的泰勒级数

    该函数使用Taylor系列中的以下开发计算 sinh(x) 的值: 我想计算sinh(3)= 10.01787的值,但函数输出9.我也得到这个警告: 1> main.c(24):警告C4244:'function':从'double'转换为'int',可能会丢失数据 这是我的代码: int fattoriale(int n) { int risultato = 1; i...
  • 1 votes
     answers
     views

    使用泰勒级数C计算Pi

    我正在尝试使用泰勒系列实现一个函数来计算pi,这是我的代码 #include <iostream> #include <math.h> using namespace std; double pi(int n) { double sum = 1.0; int sign = -1; for (int i = 1; i < n; i++) { sum += s...
  • 0 votes
     answers
     views

    用c中的泰勒级数计算Pi的函数

    所以我不知道为什么我的代码不能正常工作,基本上我正在编写的函数使用泰勒系列计算Pi的估计值,只要我尝试运行程序就会崩溃 . 这是我的代码 #include <iostream> #include <math.h> #include <stdlib.h> using namespace std; double get_pi(double accuracy) { ...

热门问题