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

📄 tst_acos.c

📁 这是《Keil Cx51 V7.0单片机高级语言编程与uVision2应用实践》教材各章中列出的全部程序例子。
💻 C
字号:
#include <math.h>
#include <stdio.h>                   /* for printf */
void tst_acos (void) {
   float x;
   float y;
   for (x = -1.0; x <= 1.0; x += 0.1) {
      y = acos (x);
      printf ("ACOS(%f) = %f\n", x, y);
   }
}

void tst_asin (void) {
  float x;
  float y;
  for (x = -1.0; x <= 1.0; x += 0.1) {
    y = asin (x);
    printf ("ASIN(%f) = %f\n", x, y);
  }
}

void tst_atan (void) {
  float x;
  float y;
  for (x = -10.0; x <= 10.0; x += 0.1) {
    y = atan (x);
    printf ("ATAN(%f) = %f\n", x, y);
  }
}

void tst_atan2 () {
  float x;
  float y;
  float z;
  x = -1.0;
  for (y = -10.0; y < 10.0; y += 0.1) {
    z = atan2 (y,x);
    printf ("ATAN2(%f/%f) = %f\n", y, x, z);
  }
    /* z approaches -pi as y goes from -10 to 0 */
    /* z approaches +pi as y goes from +10 to 0 */
}

⌨️ 快捷键说明

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