
Read it right next to your computer.
Book version bitter C
数直線上における原点からの距離。
要するに、正の値はそのまま、負の値は正にしたnumerics。
exponent = pow(numerics, 指数);
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
printf("%d\n", abs(10));
printf("%d\n", abs(-10));
return;
}
#include <stdio.h>
#include <stdlib.h>
void main(void)
{
printf("%d\n", abs(10));
printf("%d\n", abs(-10));
return;
}
#include <math.h>
#include <stdio.h>
void main(void)
{
printf("%dの%d乗 = %f\n", 5, 2, pow(5, 2));
printf("%dの%d乗 = %f\n", 8, 3, pow(8, 3));
printf("%dの%d乗 = %f\n", 2, 10, pow(2, 10));
return;
}
2乗するとその数になるnumerics。
元のnumericsを正方形の面積とすると、square rootは辺の長さに当たる。
square root = sqrt(numerics);
#include <math.h>
#include <stdio.h>
void main(void)
{
printf("√%d = %f : %f * %f = %f\n", 100, sqrt(100), sqrt(100), sqrt(100), sqrt(100) * sqrt(100));
printf("√%d = %f : %f * %f = %f\n", 2, sqrt(2), sqrt(2), sqrt(2), sqrt(2) * sqrt(2));
return;
}
function名 | Trigonometric functions値 |
---|---|
sin | サイン |
cos | コサイン |
tan | タンジェント |
asin | アークサイン |
acos | アークコサイン |
atan | アークタンジェント |
タンジェント = tan(radians角度);
円弧と半径の長さが等しくなる位置を1radiansとする角度の単位。
コンピュータの世界ではほとんどの場合にradiansを使用する。
#define RADIAN(ARC) ((ARC)*3.14159 / 180)
#include <math.h>
#include <stdio.h>
#define RADIAN(ARC) ((ARC)*3.14159 / 180)
void main(void)
{
double stature = 160;
double distance = 500;
double arc = 40;
double tree;
tree = distance * tan(RADIAN(arc)) + stature;
printf("%fm\n", tree / 100);
return;
}
Learning C language through suffering (Kushi C) is
This is the definitive introduction to the C language.
It systematically explains the basic functions of the C language.
The quality is equal to or higher than commercially available books.