⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chap13.lst

📁 Borland C++ Builder The Complete Reference 例程源代码
💻 LST
字号:
listing 1
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("arc cosine of %f is %f\n", val, acos(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 2
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("arc sine of %f is %f\n", val, asin(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 3
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("arc tangent of %f is %f\n", val, atan(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 4
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double y = -1.0; 
 
  do { 
    printf("atan2 of %f is %f\n", y, atan2(y, 1.0)); 
    y += 0.1; 
  } while(y <= 1.0); 
 
  return 0; 
}

listing 5
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  struct complex z; 
 
  z.x = 1; 
  z.y = 2; 
 
  printf("%f", cabs(z)); 
 
  return 0; 
}

listing 6
printf("%f", ceil(9.9));

listing 7
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("cosine of %f is %f\n", val, cos(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 8
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("hyperbolic cosine of %f is %f\n", val, cosh(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 9
printf("Value of e to the first: %f", exp(1.0));

listing 10
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  printf("%1.1f %1.1f", fabs(1.0), fabs(-1.0)); 
 
  return 0; 
}

listing 11
printf("%f", floor(10.9));

listing 12
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  printf("%1.1f", fmod(10.0, 3.0)); 
 
  return 0; 
}

listing 13
int e; 
double f; 
 
f = frexp(10.0, &e); 
printf("%f %d", f, e);

listing 14
printf("%f", hypot(2, 1));

listing 15
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  printf("%f", ldexp(1, 2)); 
 
  return 0; 
}

listing 16
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = 1.0; 
 
  do { 
    printf("%f %f\n", val, log(val)); 
    val++; 
  } while (val < 11.0); 
 
  return 0; 
}

listing 17
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = 1.0; 
 
  do { 
    printf("%f %f\n", val, log10(val)); 
    val++; 
  } while (val < 11.0); 
 
  return 0; 
}

listing 19
double i; 
double f; 
 
f = modf(10.123, &i); 
printf("%f %f", i, f);

listing 20
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double c[2]; 
 
  c[1] = 2; 
  c[0] = 45; 
  printf("%f", poly(1, 2, c)); 
 
  return 0; 
}

listing 21
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double x=12.0, y=0.0; 
 
  do { 
    printf("%f\n", pow(x, y)); 
    y++; 
  } while(y<11); 
 
  return 0; 
}

listing 22
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  int x=0; 
 
  while(x < 11) 
    printf("%f\n", pow10(x++)); 
 
  return 0; 
}

listing 23
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("sine of %f is %f\n", val, sin(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 25
printf("%f", sqrt(16.0));

listing 26
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("tangent of %f is %f\n", val, tan(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

listing 27
#include <stdio.h> 
#include <math.h> 
 
int main(void) 
{ 
  double val = -1.0; 
 
  do { 
    printf("Hyperbolic tangent of %f is %f\n", val, tanh(val)); 
    val += 0.1; 
  } while(val <= 1.0); 
 
  return 0; 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -